Пример #1
0
 private void ShowInfo(int StoreHouse_ID)
 {
     ZhangWei.BLL.StoreHouse   bll   = new ZhangWei.BLL.StoreHouse();
     ZhangWei.Model.StoreHouse model = bll.GetModel(StoreHouse_ID);
     this.lblStoreHouse_ID.Text       = model.StoreHouse_ID.ToString();
     this.txtAddress.Text             = model.Address;
     this.txtPhone.Text               = model.Phone;
     this.DropDownList1.SelectedValue = model.Employee_ID.ToString();
     this.Label1.Text = model.CreateDate.ToString();
 }
Пример #2
0
 private void ShowInfo(int StoreHouse_ID)
 {
     ZhangWei.BLL.StoreHouse   bll   = new ZhangWei.BLL.StoreHouse();
     ZhangWei.Model.StoreHouse model = bll.GetModel(StoreHouse_ID);
     this.lblStoreHouse_ID.Text = model.StoreHouse_ID.ToString();
     this.lblAddress.Text       = model.Address;
     this.lblPhone.Text         = model.Phone;
     this.lblEmployee_ID.Text   = model.Employee_ID.ToString();
     this.lblCreateDate.Text    = model.CreateDate.ToString();
 }
Пример #3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtAddress.Text.Trim().Length == 0)
            {
                strErr += "Address不能为空!\\n";
            }
            if (this.txtPhone.Text.Trim().Length == 0)
            {
                strErr += "Phone不能为空!\\n";
            }
            //if(!PageValidate.IsNumber(txtEmployee_ID.Text))
            //{
            //    strErr+="Employee_ID格式错误!\\n";
            //}
            if (!PageValidate.IsDateTime(Label1.Text))
            {
                strErr += "CreateDate格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      StoreHouse_ID = int.Parse(this.lblStoreHouse_ID.Text);
            string   Address       = this.txtAddress.Text;
            string   Phone         = this.txtPhone.Text;
            int      Employee_ID   = int.Parse(this.DropDownList1.SelectedValue);
            DateTime CreateDate    = DateTime.Parse(this.Label1.Text);


            ZhangWei.Model.StoreHouse model = new ZhangWei.Model.StoreHouse();
            model.StoreHouse_ID = StoreHouse_ID;
            model.Address       = Address;
            model.Phone         = Phone;
            model.Employee_ID   = Employee_ID;
            model.CreateDate    = CreateDate;

            ZhangWei.BLL.StoreHouse bll = new ZhangWei.BLL.StoreHouse();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }