Ejemplo n.º 1
0
        private void BindData()
        {
            StockLimitBLL bll       = null;
            DataPage      dp        = new DataPage();
            WHStockLimit  condition = new WHStockLimit();
            string        whID      = Request.QueryString["whID"];

            try
            {
                bll = BLLFactory.CreateBLL <StockLimitBLL>();
                this.hiWHID.Value   = whID;
                condition.MatID     = this.MatID.SelectedValue;
                condition.Warehouse = whID;

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

                List <WHStockLimit> list = dp.Result as List <WHStockLimit>;
                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]["ID"].ToString());

                    (this.GvList.Rows[i].Cells[8].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            WHStockLimit  info = new WHStockLimit();
            StockLimitBLL bll  = null;

            try
            {
                UIBindHelper.BindModelByControls(this.Page, info);

                bll            = BLLFactory.CreateBLL <StockLimitBLL>();
                info.Warehouse = this.Warehourse.SelectedValue;
                if (this.hiID.Value == "")
                {
                    bll.Insert(info);
                }
                else
                {
                    info.CREATEUSER = this.HiCREATEUSER.Value;
                    info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                    info.ID         = this.hiID.Value;
                    bll.Update(info);
                }

                ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList     pkArray = null;
            StockLimitBLL bll     = null;

            try
            {
                bll = BLLFactory.CreateBLL <StockLimitBLL>();

                pkArray = GvHelper.GetPKValueByChk(this.GvList, 0, "cbxSelect", 0);

                foreach (object key in pkArray)
                {
                    bll.Delete(new WHStockLimit {
                        ID = key.ToString()
                    });
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 4
0
        private void BindData()
        {
            string        id   = Request.QueryString["id"];
            StockLimitBLL bll  = null;
            WHStockLimit  info = new WHStockLimit();
            string        whID = Request.QueryString["whID"];

            try
            {
                if (string.IsNullOrEmpty(whID) == false)
                {
                    this.Warehourse.Enabled = false;
                }
                else
                {
                    this.Warehourse.Enabled = true;
                }


                bll = BLLFactory.CreateBLL <StockLimitBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.ID = id;
                    info    = bll.Get(info);

                    UIBindHelper.BindForm(this.Page, info);
                    this.Warehourse.SelectedValue = info.Warehouse;
                    this.hiID.Value         = info.ID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();

                    this.Warehourse.Enabled = false;
                }
                else
                {
                    info = new WHStockLimit();
                    this.Warehourse.SelectedValue = whID;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }