Пример #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtPhaseTitle.Text.Trim().Length == 0)
            {
                strErr += "PhaseTitle不能为空!\\n";
            }
            if (!PageValidate.IsDecimal(txtPhaseBNum.Text))
            {
                strErr += "PhaseBNum格式错误!\\n";
            }
            if (!PageValidate.IsDecimal(txtPhaseENum.Text))
            {
                strErr += "PhaseENum格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string  PhaseTitle = this.txtPhaseTitle.Text;
            decimal PhaseBNum  = decimal.Parse(this.txtPhaseBNum.Text);
            decimal PhaseENum  = decimal.Parse(this.txtPhaseENum.Text);

            WebDemo.Model.WebDemo.DosagePhase model = new WebDemo.Model.WebDemo.DosagePhase();
            model.PhaseTitle = PhaseTitle;
            model.PhaseBNum  = PhaseBNum;
            model.PhaseENum  = PhaseENum;

            WebDemo.BLL.WebDemo.DosagePhase bll = new WebDemo.BLL.WebDemo.DosagePhase();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Пример #2
0
 private void ShowInfo(int id)
 {
     WebDemo.BLL.WebDemo.DosagePhase   bll   = new WebDemo.BLL.WebDemo.DosagePhase();
     WebDemo.Model.WebDemo.DosagePhase model = bll.GetModel(id);
     this.lblid.Text         = model.id.ToString();
     this.txtPhaseTitle.Text = model.PhaseTitle;
     this.txtPhaseBNum.Text  = model.PhaseBNum.ToString();
     this.txtPhaseENum.Text  = model.PhaseENum.ToString();
 }