Example #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtDept_ID.Text))
            {
                strErr += "Dept_ID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtSupplier_ID.Text))
            {
                strErr += "Supplier_ID格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int Dept_ID     = int.Parse(this.txtDept_ID.Text);
            int Supplier_ID = int.Parse(this.txtSupplier_ID.Text);

            ZhangWei.Model.Dept_Supplier model = new ZhangWei.Model.Dept_Supplier();
            model.Dept_ID     = Dept_ID;
            model.Supplier_ID = Supplier_ID;

            ZhangWei.BLL.Dept_Supplier bll = new ZhangWei.BLL.Dept_Supplier();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Example #2
0
 private void ShowInfo()
 {
     ZhangWei.BLL.Dept_Supplier   bll   = new ZhangWei.BLL.Dept_Supplier();
     ZhangWei.Model.Dept_Supplier model = bll.GetModel();
     this.txtDept_ID.Text     = model.Dept_ID.ToString();
     this.txtSupplier_ID.Text = model.Supplier_ID.ToString();
 }