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

            if (this.txtBoxID.Text.Trim().Length == 0)
            {
                strErr += "BoxID不能为空!\\n";
            }
            if (this.txtSN.Text.Trim().Length == 0)
            {
                strErr += "SN不能为空!\\n";
            }
            if (this.txtQty.Text.Trim().Length == 0)
            {
                strErr += "Qty不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string BoxID = this.txtBoxID.Text;
            string SN    = this.txtSN.Text;
            string Qty   = this.txtQty.Text;

            Maticsoft.Model.tb_Encasement model = new Maticsoft.Model.tb_Encasement();
            model.BoxID = BoxID;
            model.SN    = SN;
            model.Qty   = Qty;

            Maticsoft.BLL.tb_Encasement bll = new Maticsoft.BLL.tb_Encasement();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Example #2
0
 private void ShowInfo(decimal ID)
 {
     Maticsoft.BLL.tb_Encasement   bll   = new Maticsoft.BLL.tb_Encasement();
     Maticsoft.Model.tb_Encasement model = bll.GetModel(ID);
     this.lblID.Text    = model.ID.ToString();
     this.lblBoxID.Text = model.BoxID;
     this.lblSN.Text    = model.SN;
     this.lblQty.Text   = model.Qty;
 }