using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using SysCore;
using SysCore.Model;
using SysCore.DAL;
using SysCore.Control;

public partial class Stock_Report_IOTypeSummary : System.Web.UI.Page
{
    public Hashtable xview = new Hashtable();
    public AuthUI auth = new AuthUI();
    public ConfigReader cfg = new ConfigReader();
    AWGridFun aw = new AWGridFun();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            new LoginState().CheckLogin();
            xview.Add("begin_date", new LoginInfo().GetSearchBeginDate());
            xview.Add("end_date", new LoginInfo().login_date);
            //模块权限编号,同时作为模块号
            string auth_code = "Stock_Report_IOTypeSummary";
            xview.Add("auth_code", auth_code);
            //加载页面时建议不要指定网址，搜索时动态指定即可
            string url = "";
            xview.Add("grid_frame",aw.CreateGridFrame(url));
            SqlUtil su = new SqlUtil();
            //生成收发级次下拉框
            DataTable dt_layer = su.GetDataTable("select distinct layer from Base_IOType order by layer", null);
            string layer_options = "";
            foreach (DataRow dr in dt_layer.Rows)
            {
                layer_options += "<option value='" + dr["layer"] + "'>" + dr["layer"] + "</option>";
            }
            xview.Add("layer_options", layer_options);
            //生成仓库
            DataTable dt_wh = su.GetDataTable("select wh_id,wh_name from Base_Warehouse order by wh_code", null);
            string wh_box = "";
            foreach (DataRow dr in dt_wh.Rows)
            {
                wh_box += "<input type='checkbox' name='wh_id' value='" + dr["wh_id"] + "'>" + dr["wh_name"] + "</br>";
            }
            xview.Add("wh_box", wh_box);
        }
    }
}