Ejemplo n.º 1
0
        private void BindData()
        {
            StockBLL    bll       = null;
            DataPage    dp        = new DataPage();
            WHMatAmount condition = new WHMatAmount();

            try
            {
                bll = BLLFactory.CreateBLL <StockBLL>();
                condition.Warehouse   = this.Warehouse.SelectedValue;
                condition.ProductType = this.ProductType.SelectedValue;
                condition.MatID       = this.MatID.SelectedValue;
                condition.IsDetail    = this.CbxDetail.Checked;
                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

                if (condition.IsDetail == false)
                {
                    this.GvList.Columns[1].Visible  = false;
                    this.GvList.Columns[2].Visible  = false;
                    this.GvList.Columns[8].Visible  = false;
                    this.GvList.Columns[9].Visible  = false;
                    this.GvList.Columns[10].Visible = false;
                    this.GvList.Columns[12].Visible = false;
                    this.GvList.Columns[13].Visible = false;
                }
                else
                {
                    this.GvList.Columns[1].Visible  = true;
                    this.GvList.Columns[2].Visible  = true;
                    this.GvList.Columns[8].Visible  = true;
                    this.GvList.Columns[9].Visible  = true;
                    this.GvList.Columns[10].Visible = true;
                    this.GvList.Columns[12].Visible = true;
                    this.GvList.Columns[13].Visible = true;
                }

                List <WHMatAmount> list = dp.Result as List <WHMatAmount>;
                this.GvList.DataSource = list;
                this.GvList.DataBind();

                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }