コード例 #1
0
        /// <summary>
        /// 确认
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btConfirm_Click(object sender, EventArgs e)
        {
            CheckStockBill info = new CheckStockBill();
            CheckStockBLL  bll  = null;

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

                bll = BLLFactory.CreateBLL <CheckStockBLL>();

                info.Details = JsonConvertHelper.DeserializeObject <List <CheckStockDetail> >(this.hiCheckList.Value);

                info.CREATEUSER = this.HiCREATEUSER.Value;
                info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                info.ID         = this.hiID.Value;
                bll.ConfirmCheck(info);

                ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList     pkArray = null;
            CheckStockBLL bll     = null;

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

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

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

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        private void BindData()
        {
            string         id   = Request.QueryString["id"];
            CheckStockBLL  bll  = null;
            CheckStockBill info = new CheckStockBill();

            try
            {
                bll = BLLFactory.CreateBLL <CheckStockBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.ID = id;
                    info    = bll.GetInfo(info);
                    UIBindHelper.BindForm(this.Page, info);
                    this.hiID.Value         = info.ID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                    this.BillDate.Text      = info.BillDate.ToString("yyyy-MM-dd");
                }


                this.IsConfirmName.Text = info.IsConfirm == 0 ? "未确认" : "已确认";

                //绑定明细
                DataGridResult <CheckStockDetail> matList = new DataGridResult <CheckStockDetail>();
                matList.Total = 0;
                matList.Rows  = info.Details;

                this.hiCheckList.Value = matList.GetJsonSource();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
        private void BindData()
        {
            CheckStockBLL  bll       = null;
            DataPage       dp        = new DataPage();
            CheckStockBill condition = new CheckStockBill();

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

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

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    this.GvList.Rows[i].Cells[6].Text = this.GvList.Rows[i].Cells[6].Text == "0" ? "未确认" : "已确认";

                    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["ID"].ToString());

                    LinkButton btEdit = (this.GvList.Rows[i].Cells[9].FindControl("lbtEdit") as LinkButton);
                    if (this.GvList.Rows[i].Cells[6].Text == "已确认")
                    {
                        btEdit.Visible = false;
                    }
                    else
                    {
                        //绑定编辑功能
                        btEdit.Attributes.Add("onclick", click);
                    }

                    //绑定查看功能
                    (this.GvList.Rows[i].Cells[8].FindControl("lbtView") as LinkButton)
                    .Attributes.Add("onclick", "return view('" + this.GvList.DataKeys[i]["ID"].ToString() + "');");
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
        private void BindData()
        {
            string         id   = Request.QueryString["id"];
            CheckStockBLL  bll  = null;
            CheckStockBill info = new CheckStockBill();

            try
            {
                bll = BLLFactory.CreateBLL <CheckStockBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.ID = id;
                    info    = bll.GetInfo(info);
                    UIBindHelper.BindForm(this.Page, info);
                    this.hiID.Value         = info.ID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                    this.BillDate.Text      = info.BillDate.ToString("yyyy-MM-dd");

                    this.btConfirm.Visible = true;
                    this.btBuild.Visible   = false;
                }
                else
                {
                    info               = new CheckStockBill();
                    info.Details       = new List <CheckStockDetail>();
                    this.BillNO.Text   = bll.GetNewBillNO();
                    this.BillDate.Text = DateTime.Now.ToString("yyyy-MM-dd");

                    LoginInfo user = this.GetLoginInfo();
                    this.CheckHeader.SelectedValue = user.UserID;
                }

                this.IsConfirmName.Text = info.IsConfirm == 0 ? "未确认" : "已确认";

                //绑定明细
                DataGridResult <CheckStockDetail> matList = new DataGridResult <CheckStockDetail>();
                matList.Total = 0;
                matList.Rows  = info.Details.OrderBy(p => p.Seq).ToList();

                this.hiCheckList.Value = matList.GetJsonSource();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #6
0
        /// <summary>
        /// 生成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btBuild_Click(object sender, EventArgs e)
        {
            CheckStockBill info = new CheckStockBill();
            CheckStockBLL  bll  = null;

            bll = BLLFactory.CreateBLL <CheckStockBLL>();

            info = bll.BuildBill(new CheckStockBill {
                Warehouse = this.Warehouse.SelectedValue, AreaID = this.AreaID.SelectedValue
            });

            this.BillNO.Text = info.BillNO;
            //绑定明细
            DataGridResult <CheckStockDetail> matList = new DataGridResult <CheckStockDetail>();

            matList.Total = 0;
            matList.Rows  = info.Details;

            this.hiCheckList.Value = matList.GetJsonSource();
        }