Ejemplo n.º 1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtM_Time.Text.Trim().Length==0)
            {
                strErr+="服药时间点(24小时制不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtMedicationID.Text))
            {
                strErr+="与record_Medicat格式错误!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int MedicationTimeID=int.Parse(this.lblMedicationTimeID.Text);
            string M_Time=this.txtM_Time.Text;
            int MedicationID=int.Parse(this.txtMedicationID.Text);

            Maticsoft.Model.record_MedicationTime model=new Maticsoft.Model.record_MedicationTime();
            model.MedicationTimeID=MedicationTimeID;
            model.M_Time=M_Time;
            model.MedicationID=MedicationID;

            Maticsoft.BLL.record_MedicationTime bll=new Maticsoft.BLL.record_MedicationTime();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx");
        }
Ejemplo n.º 2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtM_Time.Text.Trim().Length == 0)
            {
                strErr += "服药时间点(24小时制不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtMedicationID.Text))
            {
                strErr += "与record_Medicat格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    MedicationTimeID = int.Parse(this.lblMedicationTimeID.Text);
            string M_Time           = this.txtM_Time.Text;
            int    MedicationID     = int.Parse(this.txtMedicationID.Text);


            Maticsoft.Model.record_MedicationTime model = new Maticsoft.Model.record_MedicationTime();
            model.MedicationTimeID = MedicationTimeID;
            model.M_Time           = M_Time;
            model.MedicationID     = MedicationID;

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