示例#1
0
        private void BindData()
        {
            SupplyInfoBLL bll       = null;
            DataPage      dp        = new DataPage();
            SupplyInfo    condition = new SupplyInfo();

            try
            {
                bll = BLLFactory.CreateBLL <SupplyInfoBLL>();
                condition.BATCHNUMBER = this.BatchNumber.Text;


                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

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

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["PID"].ToString());

                    (this.GvList.Rows[i].Cells[7].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        private void BindData()
        {
            string        id   = Request.QueryString["id"];
            SupplyInfoBLL bll  = null;
            SupplyInfo    info = new SupplyInfo();

            try
            {
                bll = BLLFactory.CreateBLL <SupplyInfoBLL>();
                if (!string.IsNullOrEmpty(id))
                {
                    info.PID     = id;
                    info         = bll.Get(info);
                    info.Details = bll.GetList(info.PID);
                    UIBindHelper.BindForm(this.Page, info);
                    this.FNAME.Text          = info.FactoryName;
                    this.PDNAME.Text         = info.ProduceName;
                    this.PLNAME.Text         = info.PLName;
                    this.DELIVERYDATE.Text   = info.DELIVERYDATE.ToString("yyyy-MM-dd");
                    this.REMARK.Text         = info.REMARK;
                    this.hiID.Value          = info.PID;
                    this.HiCREATEUSER.Value  = info.CREATEUSER;
                    this.HiCREATETIME.Value  = info.CREATETIME.ToString();
                    this.hiPlanID.Value      = info.PLANID;
                    this.PLNAME.Text         = info.PLName;
                    this.BatchNumber.Visible = true;
                    this.PLANID.Visible      = false;
                }
                else
                {
                    info                     = new SupplyInfo();
                    info.Details             = new List <SupplyMaterialInfo>();
                    this.BatchNumber.Visible = false;
                    this.PLANID.Visible      = true;
                }

                //绑定明细
                DataGridResult <SupplyMaterialInfo> supplyMaterialInfo = new DataGridResult <SupplyMaterialInfo>();
                supplyMaterialInfo.Total = info.Details.Count;
                supplyMaterialInfo.Rows  = info.Details;

                foreach (SupplyMaterialInfo detail in info.Details)
                {
                    detail.DeleteAction = "deleteItem(\'" + detail.MATRIALID + "\')";
                }

                this.hiMaterialList.Value = supplyMaterialInfo.GetJsonSource();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }