コード例 #1
0
ファイル: Show.aspx.cs プロジェクト: radtek/EicMcp
 private void ShowInfo(decimal C_StoID)
 {
     Maticsoft.BLL.ConsumableStorage   bll   = new Maticsoft.BLL.ConsumableStorage();
     Maticsoft.Model.ConsumableStorage model = bll.GetModel(C_StoID);
     this.lblC_StoID.Text   = model.C_StoID.ToString();
     this.lblC_Barcode.Text = model.C_Barcode;
     this.lblCount.Text     = model.Count.ToString();
     this.lblUserName.Text  = model.UserName;
     this.lblDatetime.Text  = model.Datetime;
     this.lblRemarks.Text   = model.Remarks;
 }
コード例 #2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtC_Barcode.Text.Trim().Length == 0)
            {
                strErr += "C_Barcode不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtCount.Text))
            {
                strErr += "Count格式错误!\\n";
            }
            if (this.txtUserName.Text.Trim().Length == 0)
            {
                strErr += "UserName不能为空!\\n";
            }
            if (this.txtDatetime.Text.Trim().Length == 0)
            {
                strErr += "Datetime不能为空!\\n";
            }
            if (this.txtRemarks.Text.Trim().Length == 0)
            {
                strErr += "Remarks不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            decimal C_StoID   = decimal.Parse(this.lblC_StoID.Text);
            string  C_Barcode = this.txtC_Barcode.Text;
            int     Count     = int.Parse(this.txtCount.Text);
            string  UserName  = this.txtUserName.Text;
            string  Datetime  = this.txtDatetime.Text;
            string  Remarks   = this.txtRemarks.Text;


            Maticsoft.Model.ConsumableStorage model = new Maticsoft.Model.ConsumableStorage();
            model.C_StoID   = C_StoID;
            model.C_Barcode = C_Barcode;
            model.Count     = Count;
            model.UserName  = UserName;
            model.Datetime  = Datetime;
            model.Remarks   = Remarks;

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