示例#1
0
 private void ShowInfo(int MID)
 {
     ERP.BLL.Materials   bll   = new ERP.BLL.Materials();
     ERP.Model.Materials model = bll.GetModel(MID);
     this.lblMID.Text       = model.MID.ToString();
     this.lblMCode.Text     = model.MCode.ToString();
     this.lblMName.Text     = model.MName;
     this.lblMModel.Text    = model.MModel;
     this.lblMMaterial.Text = model.MMaterial;
     this.lblMStandard.Text = model.MStandard;
     this.lblMUnit.Text     = model.MUnit;
     this.lblMNumber.Text   = model.MNumber.ToString();
     this.lblWName.Text     = model.WName;
 }
示例#2
0
        protected void ButtonSubmit_Click(object sender, EventArgs e)
        {
            ERP.BLL.Materials   bll   = new ERP.BLL.Materials();
            ERP.Model.Materials model = new ERP.Model.Materials();

            model.MCode     = Convert.ToInt32(TextBoxMCode.Text);
            model.MName     = TextBoxMName.Text.ToString();
            model.MModel    = TextBoxMModel.Text.ToString();
            model.MMaterial = TextBoxMMaterial.Text.ToString();
            model.MStandard = TextBoxMStandard.Text.ToString();
            model.MUnit     = TextBoxMUnit.Text.ToString();
            model.MNumber   = Convert.ToInt32(TextBoxMNumber.Text);
            //仓库名称-由下拉菜单选择
            model.WName = DropDownList.Text.ToString();

            try
            {
                bll.Add(model);
                Response.Write("<script>alert('插入成功');history.back()</script>");

                TextBoxMCode.Text     = "";
                TextBoxMName.Text     = "";
                TextBoxMModel.Text    = "";
                TextBoxMMaterial.Text = "";
                TextBoxMStandard.Text = "";
                TextBoxMUnit.Text     = "";
                TextBoxMNumber.Text   = "";
            }
            catch (Exception)
            {
                Response.Write("<script>alert('插入失败');history.back()</script>");

                TextBoxMCode.Text     = "";
                TextBoxMName.Text     = "";
                TextBoxMModel.Text    = "";
                TextBoxMMaterial.Text = "";
                TextBoxMStandard.Text = "";
                TextBoxMUnit.Text     = "";
                TextBoxMNumber.Text   = "";
            }
        }
示例#3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtMCode.Text))
            {
                strErr += "MCode格式错误!\\n";
            }
            if (this.txtMModel.Text.Trim().Length == 0)
            {
                strErr += "MModel不能为空!\\n";
            }
            if (this.txtMMaterial.Text.Trim().Length == 0)
            {
                strErr += "MMaterial不能为空!\\n";
            }
            if (this.txtMStandard.Text.Trim().Length == 0)
            {
                strErr += "MStandard不能为空!\\n";
            }
            if (this.txtMUnit.Text.Trim().Length == 0)
            {
                strErr += "MUnit不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtMNumber.Text))
            {
                strErr += "MNumber格式错误!\\n";
            }
            if (this.txtWName.Text.Trim().Length == 0)
            {
                strErr += "WName不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    MID       = int.Parse(this.lblMID.Text);
            int    MCode     = int.Parse(this.txtMCode.Text);
            string MName     = this.lblMName.Text;
            string MModel    = this.txtMModel.Text;
            string MMaterial = this.txtMMaterial.Text;
            string MStandard = this.txtMStandard.Text;
            string MUnit     = this.txtMUnit.Text;
            int    MNumber   = int.Parse(this.txtMNumber.Text);
            string WName     = this.txtWName.Text;


            ERP.Model.Materials model = new ERP.Model.Materials();
            model.MID       = MID;
            model.MCode     = MCode;
            model.MName     = MName;
            model.MModel    = MModel;
            model.MMaterial = MMaterial;
            model.MStandard = MStandard;
            model.MUnit     = MUnit;
            model.MNumber   = MNumber;
            model.WName     = WName;

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