Exemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtCUSTOM_CODE.Text.Trim().Length == 0)
            {
                strErr += "CUSTOM_CODE不能为空!\\n";
            }
            if (this.txtCUSTOM_NAME.Text.Trim().Length == 0)
            {
                strErr += "CUSTOM_NAME不能为空!\\n";
            }
            if (this.txtZBBH.Text.Trim().Length == 0)
            {
                strErr += "ZBBH不能为空!\\n";
            }
            if (this.txtPZMC.Text.Trim().Length == 0)
            {
                strErr += "PZMC不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtPRICE.Text))
            {
                strErr += "PRICE格式错误!\\n";
            }
            if (this.txtCREATE_NAME.Text.Trim().Length == 0)
            {
                strErr += "CREATE_NAME不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtCREATE_DATE.Text))
            {
                strErr += "CREATE_DATE格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string   CUSTOM_CODE = this.txtCUSTOM_CODE.Text;
            string   CUSTOM_NAME = this.txtCUSTOM_NAME.Text;
            string   ZBBH        = this.txtZBBH.Text;
            string   PZMC        = this.txtPZMC.Text;
            decimal  PRICE       = decimal.Parse(this.txtPRICE.Text);
            string   CREATE_NAME = this.txtCREATE_NAME.Text;
            DateTime CREATE_DATE = DateTime.Parse(this.txtCREATE_DATE.Text);

            MyERP.Model.ORDER_ZBPrice model = new MyERP.Model.ORDER_ZBPrice();
            model.CUSTOM_CODE = CUSTOM_CODE;
            model.CUSTOM_NAME = CUSTOM_NAME;
            model.ZBBH        = ZBBH;
            model.PZMC        = PZMC;
            model.PRICE       = PRICE;
            model.CREATE_NAME = CREATE_NAME;
            model.CREATE_DATE = CREATE_DATE;

            MyERP.BLL.ORDER_ZBPrice bll = new MyERP.BLL.ORDER_ZBPrice();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Exemplo n.º 2
0
 private void ShowInfo()
 {
     MyERP.BLL.ORDER_ZBPrice   bll   = new MyERP.BLL.ORDER_ZBPrice();
     MyERP.Model.ORDER_ZBPrice model = bll.GetModel();
     this.lblCUSTOM_CODE.Text = model.CUSTOM_CODE;
     this.lblCUSTOM_NAME.Text = model.CUSTOM_NAME;
     this.lblZBGGID.Text      = model.ZBGGID.ToString();
     this.lblZBBH.Text        = model.ZBBH;
     this.lblPZMC.Text        = model.PZMC;
     this.lblPRICE.Text       = model.PRICE.ToString();
     this.lblCREATE_NAME.Text = model.CREATE_NAME;
     this.lblCREATE_DATE.Text = model.CREATE_DATE.ToString();
 }