예제 #1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsDateTime(txtWriteDate.Text))
            {
                strErr += "WriteDate格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtInsureDate.Text))
            {
                strErr += "InsureDate格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtEndDate.Text))
            {
                strErr += "EndDate格式错误!\\n";
            }
            //if (!PageValidate.IsNumber(txtDept_ID.Text))
            //{
            //    strErr += "Dept_ID格式错误!\\n";
            //}
            //if (!PageValidate.IsNumber(txtSupplier_ID.Text))
            //{
            //    strErr += "Supplier_ID格式错误!\\n";
            //}
            //if (!PageValidate.IsNumber(txtEmployee_ID.Text))
            //{
            //    strErr += "Employee_ID格式错误!\\n";
            //}

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      BuyOrder_ID = int.Parse(this.lblBuyOrder_ID.Text);
            DateTime WriteDate   = DateTime.Parse(this.txtWriteDate.Text);
            DateTime InsureDate  = DateTime.Parse(this.txtInsureDate.Text);
            DateTime EndDate     = DateTime.Parse(this.txtEndDate.Text);
            int      Dept_ID     = int.Parse(this.DropDownList1.SelectedValue);
            int      Supplier_ID = int.Parse(this.DropDownList2.SelectedValue);
            int      Employee_ID = int.Parse(this.DropDownList3.SelectedValue);


            ZhangWei.Model.BuyOrder model = new ZhangWei.Model.BuyOrder();
            model.BuyOrder_ID = BuyOrder_ID;
            model.WriteDate   = WriteDate;
            model.InsureDate  = InsureDate;
            model.EndDate     = EndDate;
            model.Dept_ID     = Dept_ID;
            model.Supplier_ID = Supplier_ID;
            model.Employee_ID = Employee_ID;

            ZhangWei.BLL.BuyOrder bll = new ZhangWei.BLL.BuyOrder();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
예제 #2
0
 private void ShowInfo(int BuyOrder_ID)
 {
     ZhangWei.BLL.BuyOrder   bll   = new ZhangWei.BLL.BuyOrder();
     ZhangWei.Model.BuyOrder model = bll.GetModel(BuyOrder_ID);
     this.lblBuyOrder_ID.Text = model.BuyOrder_ID.ToString();
     this.lblWriteDate.Text   = model.WriteDate.ToString();
     this.lblInsureDate.Text  = model.InsureDate.ToString();
     this.lblEndDate.Text     = model.EndDate.ToString();
     this.lblDept_ID.Text     = model.Dept_ID.ToString();
     this.lblSupplier_ID.Text = model.Supplier_ID.ToString();
     this.lblEmployee_ID.Text = model.Employee_ID.ToString();
 }
예제 #3
0
 private void ShowInfo(int BuyOrder_ID)
 {
     ZhangWei.BLL.BuyOrder   bll   = new ZhangWei.BLL.BuyOrder();
     ZhangWei.Model.BuyOrder model = bll.GetModel(BuyOrder_ID);
     this.lblBuyOrder_ID.Text = model.BuyOrder_ID.ToString();
     this.txtWriteDate.Text   = model.WriteDate.ToString();
     this.txtInsureDate.Text  = model.InsureDate.ToString();
     this.txtEndDate.Text     = model.EndDate.ToString();
     //this.txtDept_ID.Text = model.Dept_ID.ToString();
     //this.txtSupplier_ID.Text = model.Supplier_ID.ToString();
     //this.txtEmployee_ID.Text = model.Employee_ID.ToString();
     DropDownList1.SelectedValue = model.Dept_ID.ToString();
     DropDownList2.SelectedValue = model.Supplier_ID.ToString();
     DropDownList3.SelectedValue = model.Employee_ID.ToString();
 }
예제 #4
0
 private void ShowInfo(int BuyOrder_ID)
 {
     ZhangWei.BLL.BuyOrder   bll   = new ZhangWei.BLL.BuyOrder();
     ZhangWei.Model.BuyOrder model = bll.GetModel(BuyOrder_ID);
     this.lblBuyOrder_ID.Text = "(合同编号:" + model.BuyOrder_ID.ToString() + ")";
     this.txtWriteDate.Text   = model.WriteDate.ToString();
     this.txtInsureDate.Text  = model.InsureDate.ToString();
     this.txtEndDate.Text     = model.EndDate.ToString();
     //this.txtDept_ID.Text = model.Dept_ID.ToString();
     //this.txtSupplier_ID.Text = model.Supplier_ID.ToString();
     //this.txtEmployee_ID.Text = model.Employee_ID.ToString();
     DropDownList1.SelectedValue = model.Dept_ID.ToString();
     //DropDownList2.SelectedValue = model.Supplier_ID.ToString();
     DropDownList3.SelectedValue = model.Employee_ID.ToString();
     Button1.Attributes.Add("onclick", "return confirm(\"确认入库吗?\")");
 }