Пример #1
0
        private void BindGrid()
        {
            DataSet   ds     = bll.查询全部资产信息();
            DataTable dt     = ds.Tables[0].Copy();//复制一份table
            DataTable source = dt;

            // 3.绑定到Grid
            Grid1.DataSource = dt;//DataTable
            Grid1.DataBind();
        }
Пример #2
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            School查询办公设备条件表 model = new School查询办公设备条件表();
            string          str部门 = 部门.SelectedText;

            if (str部门 != null)
            {
                model.归属部门 = Convert.ToInt32(部门.SelectedValue);
                if (负责人.SelectedText != null)
                {
                    model.负责人 = Convert.ToInt32(负责人.SelectedValue);
                }
                else
                {
                    model.负责人 = 0;
                    Alert.ShowInTop("必须选择负责人!");
                    return;
                }
            }
            else
            {
                Alert.ShowInTop("必须选择负责人!");
                return;
            }
            model.关键字 = TwinTriggerBox1.Text;
            School资产处置BLL bll    = new School资产处置BLL();
            DataSet       ds     = bll.查询全部资产信息(model);
            DataTable     dt     = ds.Tables[0].Copy();//复制一份table
            DataTable     source = dt;


            // 3.绑定到Grid
            Grid4.DataSource = dt;//DataTable
            Grid4.DataBind();
        }
Пример #3
0
        protected void btnIcon1_Click(object sender, EventArgs e)
        {
            School资产处置BLL bll    = new School资产处置BLL();
            DataSet       ds     = bll.查询全部资产信息();
            DataTable     dt     = ds.Tables[0].Copy();//复制一份table
            DataTable     source = dt;


            // 3.绑定到Grid
            Grid4.DataSource = dt;//DataTable
            Grid4.DataBind();
            //绑定条件
            School清查盘点BLL pdbll = new School清查盘点BLL();

            List <School一级部门表> xxmc = pdbll.查询一级部门();

            部门.DataTextField  = "名称";
            部门.DataValueField = "ID";
            部门.DataSource     = xxmc;
            部门.DataBind();

            List <School一级类别表> yjlb = pdbll.查询一级类别();

            一级.DataTextField  = "名称";
            一级.DataValueField = "ID";
            一级.DataSource     = yjlb;
            一级.DataBind();


            List <School建筑物信息表> 查询建筑物 = pdbll.查询建筑物信息表();

            存放地点.DataTextField  = "名称";
            存放地点.DataValueField = "ID";
            存放地点.DataSource     = 查询建筑物;
            存放地点.DataBind();


            二级.Enabled  = false;
            级.Enabled   = false;
            负责人.Enabled = false;
            房间.Enabled  = false;

            二级.EmptyText  = "全部";
            级.EmptyText   = "全部";
            负责人.EmptyText = "全部";
            房间.EmptyText  = "全部";



            Window2.Hidden = false;
        }
Пример #4
0
        private DataTable GetPagedDataTableall(int pageIndex, int pageSize)
        {
            School资产处置BLL bll    = new School资产处置BLL();
            DataSet       ds     = bll.查询全部资产信息();
            DataTable     dt     = ds.Tables[0].Copy();//复制一份table
            DataTable     source = dt;
            DataTable     paged  = source.Clone();

            int rowbegin = pageIndex * pageSize;
            int rowend   = (pageIndex + 1) * pageSize;

            if (rowend > source.Rows.Count)
            {
                rowend = source.Rows.Count;
            }

            for (int i = rowbegin; i < rowend; i++)
            {
                paged.ImportRow(source.Rows[i]);
            }

            return(paged);
        }
Пример #5
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            School查询办公设备条件表 model = new School查询办公设备条件表();
            string          str一级 = 一级.SelectedText;
            string          str二级 = 二级.SelectedText;
            string          str三级 = 级.SelectedText;

            if (str一级 == "全部" || str一级 == null)
            {
                str一级 = "";
            }
            if (str二级 == "全部" || str二级 == null)
            {
                str二级 = "";
            }
            if (str三级 == "全部" || str三级 == null)
            {
                str三级 = "";
            }
            model.一级分类 = str一级;
            model.二级分类 = str二级;
            model.级分类  = str三级;
            string str部门 = 部门.SelectedText;

            if (str部门 != "全部" && str部门 != null)
            {
                model.归属部门 = Convert.ToInt32(部门.SelectedValue);
                if (负责人.SelectedText != null)
                {
                    model.负责人 = Convert.ToInt32(负责人.SelectedValue);
                }
                else
                {
                    model.负责人 = 0;
                }
            }
            else
            {
                model.归属部门 = 0;
            }

            if (存放地点.SelectedText != null)
            {
                model.存放地点 = Convert.ToInt32(存放地点.SelectedValue);
                if (房间.SelectedText != null)
                {
                    model.房间 = Convert.ToInt32(房间.SelectedValue);
                }
                else
                {
                    model.房间 = 0;
                }
            }
            else
            {
                model.存放地点 = 0;
            }

            if (起始投入日期.Text != "")
            {
                model.起始投入日期 = Convert.ToDateTime(起始投入日期.Text).ToShortDateString();
            }
            else
            {
                model.起始投入日期 = "";
            }
            if (结束投入日期.Text != "")
            {
                model.结束投入日期 = Convert.ToDateTime(结束投入日期.Text).ToShortDateString();
            }
            else
            {
                model.结束投入日期 = "";
            }


            model.关键字 = TwinTriggerBox1.Text;

            School资产处置BLL bll    = new School资产处置BLL();
            DataSet       ds     = bll.查询全部资产信息(model);
            DataTable     dt     = ds.Tables[0].Copy();//复制一份table
            DataTable     source = dt;


            // 3.绑定到Grid
            Grid3.DataSource = dt;//DataTable
            Grid3.DataBind();

            //二级.Enabled = false;
            //三级.Enabled = false;
            //负责人.Enabled = false;
            //房间.Enabled = false;

            二级.EmptyText  = "全部";
            级.EmptyText   = "全部";
            负责人.EmptyText = "全部";
            房间.EmptyText  = "全部";
        }