Esempio n. 1
0
        private void BindData()
        {
            InStockQueryBLL bll       = null;
            DataPage        dp        = new DataPage();
            InStockBill     condition = new InStockBill();

            try
            {
                bll = BLLFactory.CreateBLL <InStockQueryBLL>();
                condition.StartDate = this.StartDate.Value;
                condition.EndDate   = this.EndDate.Value;
                condition.Warehouse = this.WarehouseID.Value;
                condition.MatID     = this.MatID.Value;
                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetInMatDetails(condition, dp);

                List <InStockQueryResult> list = dp.Result as List <InStockQueryResult>;

                foreach (InStockQueryResult detail in list)
                {
                    detail.UnitName = string.IsNullOrEmpty(detail.UnitName) == false ? detail.UnitName : detail.MainUnitName;
                }

                this.GvList.DataSource = list;
                this.GvList.DataBind();

                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        private void BindData()
        {
            InStockQueryBLL bll       = null;
            DataPage        dp        = new DataPage();
            InStockBill     condition = new InStockBill();

            try
            {
                bll = BLLFactory.CreateBLL <InStockQueryBLL>();
                condition.StartDate   = this.StartDate.Text;
                condition.EndDate     = this.EndDate.Text;
                condition.InStockMode = this.InStockMode.SelectedValue;
                condition.Warehouse   = this.Warehouse.SelectedValue;
                condition.ProductType = this.ProductType.SelectedValue;
                condition.MatID       = this.MatID.SelectedValue;
                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

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

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    //绑定查看功能
                    LinkButton lbtView = this.GvList.Rows[i].Cells[7].FindControl("lbtView") as LinkButton;
                    lbtView.OnClientClick = string.Format("view('{0}','{1}','{2}','{3}');return false;"
                                                          , this.GvList.DataKeys[i]["WarehouseID"].ToString(), this.GvList.DataKeys[i]["MatID"].ToString()
                                                          , this.StartDate.Text, this.EndDate.Text);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }