Пример #1
0
        private void BindData()
        {
            string            id   = Request.QueryString["id"];
            SchedulingInfoBLL bll  = null;
            SchedulingInfo    info = new SchedulingInfo();

            try
            {
                bll = BLLFactory.CreateBLL <SchedulingInfoBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.PID = id;
                    info     = bll.Get(info);

                    UIBindHelper.BindForm(this.Page, info);
                    this.hiID.Value         = info.PID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                }
                else
                {
                    info = new SchedulingInfo();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList         pkArray = null;
            SchedulingInfoBLL bll     = null;

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

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

                foreach (object key in pkArray)
                {
                    bll.DeleteSchedulingInfo(new SchedulingInfo {
                        PID = key.ToString()
                    });
                }

                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            SchedulingInfo    info = new SchedulingInfo();
            SchedulingInfoBLL bll  = null;

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

                bll = BLLFactory.CreateBLL <SchedulingInfoBLL>();

                if (this.hiID.Value == "")
                {
                    bll.Insert(info);
                }
                else
                {
                    info.CREATEUSER = this.HiCREATEUSER.Value;
                    info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                    info.PID        = this.hiID.Value;
                    bll.Update(info);
                }

                ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #4
0
        private void BindData()
        {
            SchedulingInfoBLL bll       = null;
            DataPage          dp        = new DataPage();
            SchedulingInfo    condition = new SchedulingInfo();

            try
            {
                bll            = BLLFactory.CreateBLL <SchedulingInfoBLL>();
                condition.FAID = this.FAID.Text;
                condition.PRID = this.PRID.Text;
                condition.WOID = this.WOID.Text;
                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

                List <SchedulingInfo> list = dp.Result as List <SchedulingInfo>;
                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[9].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }