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

            try
            {
                bll = BLLFactory.CreateBLL <OutStockQueryBLL>();
                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.GetOutMatDetails(condition, dp);

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

                foreach (OutStockQueryResult detail in list)
                {
                    detail.UnitName = string.IsNullOrEmpty(detail.UnitName) == false ? detail.UnitName : detail.MainUnitName;
                    if (detail.Amount == 0)
                    {
                        detail.Amount   = detail.MainUnitAmount;
                        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()
        {
            OutStockQueryBLL bll       = null;
            DataPage         dp        = new DataPage();
            OutStockBill     condition = new OutStockBill();

            try
            {
                bll = BLLFactory.CreateBLL <OutStockQueryBLL>();
                condition.StartDate    = this.StartDate.Text;
                condition.EndDate      = this.EndDate.Text;
                condition.OutStockMode = this.OutStockMode.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;
            }
        }