Esempio n. 1
0
 private void ShowInfo()
 {
     MyERP.BLL.STEEL_DA_BEGIN   bll   = new MyERP.BLL.STEEL_DA_BEGIN();
     MyERP.Model.STEEL_DA_BEGIN model = bll.GetModel();
     this.txtCOMPANY_CODE.Text       = model.COMPANY_CODE;
     this.txtCOMPANY_NAME.Text       = model.COMPANY_NAME;
     this.txtITEM_INTERNAL_CODE.Text = model.ITEM_INTERNAL_CODE;
     this.txtITEM_CODE.Text          = model.ITEM_CODE;
     this.txtITEM_NAME.Text          = model.ITEM_NAME;
     this.txtPARENT_ITEM_CODE.Text   = model.PARENT_ITEM_CODE;
     this.txtACTUAL_QTY.Text         = model.ACTUAL_QTY.ToString();
     this.txtCREATE_DATE.Text        = model.CREATE_DATE.ToString();
 }
Esempio n. 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtCOMPANY_CODE.Text.Trim().Length == 0)
            {
                strErr += "COMPANY_CODE不能为空!\\n";
            }
            if (this.txtCOMPANY_NAME.Text.Trim().Length == 0)
            {
                strErr += "COMPANY_NAME不能为空!\\n";
            }
            if (this.txtITEM_INTERNAL_CODE.Text.Trim().Length == 0)
            {
                strErr += "ITEM_INTERNAL_CODE不能为空!\\n";
            }
            if (this.txtITEM_CODE.Text.Trim().Length == 0)
            {
                strErr += "ITEM_CODE不能为空!\\n";
            }
            if (this.txtITEM_NAME.Text.Trim().Length == 0)
            {
                strErr += "ITEM_NAME不能为空!\\n";
            }
            if (this.txtPARENT_ITEM_CODE.Text.Trim().Length == 0)
            {
                strErr += "PARENT_ITEM_CODE不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtACTUAL_QTY.Text))
            {
                strErr += "ACTUAL_QTY格式错误!\\n";
            }
            if (!PageValidate.IsDateTime(txtCREATE_DATE.Text))
            {
                strErr += "CREATE_DATE格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   COMPANY_CODE       = this.txtCOMPANY_CODE.Text;
            string   COMPANY_NAME       = this.txtCOMPANY_NAME.Text;
            string   ITEM_INTERNAL_CODE = this.txtITEM_INTERNAL_CODE.Text;
            string   ITEM_CODE          = this.txtITEM_CODE.Text;
            string   ITEM_NAME          = this.txtITEM_NAME.Text;
            string   PARENT_ITEM_CODE   = this.txtPARENT_ITEM_CODE.Text;
            decimal  ACTUAL_QTY         = decimal.Parse(this.txtACTUAL_QTY.Text);
            DateTime CREATE_DATE        = DateTime.Parse(this.txtCREATE_DATE.Text);

            MyERP.Model.STEEL_DA_BEGIN model = new MyERP.Model.STEEL_DA_BEGIN();
            model.COMPANY_CODE       = COMPANY_CODE;
            model.COMPANY_NAME       = COMPANY_NAME;
            model.ITEM_INTERNAL_CODE = ITEM_INTERNAL_CODE;
            model.ITEM_CODE          = ITEM_CODE;
            model.ITEM_NAME          = ITEM_NAME;
            model.PARENT_ITEM_CODE   = PARENT_ITEM_CODE;
            model.ACTUAL_QTY         = ACTUAL_QTY;
            model.CREATE_DATE        = CREATE_DATE;

            MyERP.BLL.STEEL_DA_BEGIN bll = new MyERP.BLL.STEEL_DA_BEGIN();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }