/// <summary> /// 根据信息类型返回对应的信息名称 /// </summary> /// <param name="superision_type"></param> /// <returns></returns> /// <summary> /// 点击确定按钮执行的方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { Maticsoft.BLL.education_Prescription education_Prescription_bll = new Maticsoft.BLL.education_Prescription(); Maticsoft.Model.education_Prescription education_Prescription_model = education_Prescription_bll.GetModel(PrescriptionID); if (education_Prescription_model == null) { education_Prescription_model = new Maticsoft.Model.education_Prescription(); } //获取客户端通过Post方式传递过来的值的 education_Prescription_model.P_Date = (DateTime)Common.sink(this.P_Date.UniqueID, MethodType.Post, 255, 0, DataType.Dat); education_Prescription_model.P_Content = (string)Common.sink(this.P_Content.UniqueID, MethodType.Post, 0, 0, DataType.Str); education_Prescription_model.P_Object = Convert.ToInt32(this.P_Object.Value); education_Prescription_model.P_Doctor = Convert.ToInt32(this.P_Doctor.Value); education_Prescription_model.P_Name = P_Name.Text; switch (CMD) { case "New": CMD_Txt = "增加"; //增加操作调用Add方法 PrescriptionID = education_Prescription_bll.Add(education_Prescription_model); break; case "Edit": CMD_Txt = "修改"; //是修改操作调用Update方法 education_Prescription_bll.Update(education_Prescription_model); break; } All_Title_Txt = CMD_Txt + App_Txt; EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", PrescriptionID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); }
private void ShowInfo(int PrescriptionID) { Maticsoft.BLL.education_Prescription bll = new Maticsoft.BLL.education_Prescription(); Maticsoft.Model.education_Prescription model = bll.GetModel(PrescriptionID); this.lblPrescriptionID.Text = model.PrescriptionID.ToString(); this.txtP_Object.Text = model.P_Object.ToString(); this.txtP_Name.Text = model.P_Name; this.txtP_Content.Text = model.P_Content; this.txtP_Doctor.Text = model.P_Doctor.ToString(); this.txtP_Date.Text = model.P_Date.ToString(); }
private void ShowInfo(int PrescriptionID) { Maticsoft.BLL.education_Prescription bll=new Maticsoft.BLL.education_Prescription(); Maticsoft.Model.education_Prescription model=bll.GetModel(PrescriptionID); this.lblPrescriptionID.Text=model.PrescriptionID.ToString(); this.lblP_Object.Text=model.P_Object.ToString(); this.lblP_Name.Text=model.P_Name; this.lblP_Content.Text=model.P_Content; this.lblP_Doctor.Text=model.P_Doctor.ToString(); this.lblP_Date.Text=model.P_Date.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Maticsoft.BLL.education_Prescription bll = new Maticsoft.BLL.education_Prescription(); if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { int PrescriptionID = (Convert.ToInt32(Request.Params["id"])); bll.Delete(PrescriptionID); Response.Redirect("list.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Maticsoft.BLL.education_Prescription bll=new Maticsoft.BLL.education_Prescription(); if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { int PrescriptionID=(Convert.ToInt32(Request.Params["id"])); bll.Delete(PrescriptionID); Response.Redirect("list.aspx"); } } }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsDecimal(txtP_Object.Text)) { strErr += "健康处方对象格式错误!\\n"; } if (this.txtP_Name.Text.Trim().Length == 0) { strErr += "处方名称不能为空!\\n"; } if (this.txtP_Content.Text.Trim().Length == 0) { strErr += "处方内容不能为空!\\n"; } if (!PageValidate.IsNumber(txtP_Doctor.Text)) { strErr += "处方医生格式错误!\\n"; } if (!PageValidate.IsDateTime(txtP_Date.Text)) { strErr += "处方日期格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int PrescriptionID = int.Parse(this.lblPrescriptionID.Text); decimal P_Object = decimal.Parse(this.txtP_Object.Text); string P_Name = this.txtP_Name.Text; string P_Content = this.txtP_Content.Text; int P_Doctor = int.Parse(this.txtP_Doctor.Text); DateTime P_Date = DateTime.Parse(this.txtP_Date.Text); Maticsoft.Model.education_Prescription model = new Maticsoft.Model.education_Prescription(); model.PrescriptionID = PrescriptionID; model.P_Object = P_Object; model.P_Name = P_Name; model.P_Content = P_Content; model.P_Doctor = P_Doctor; model.P_Date = P_Date; Maticsoft.BLL.education_Prescription bll = new Maticsoft.BLL.education_Prescription(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsDecimal(txtP_Object.Text)) { strErr+="健康处方对象格式错误!\\n"; } if(this.txtP_Name.Text.Trim().Length==0) { strErr+="处方名称不能为空!\\n"; } if(this.txtP_Content.Text.Trim().Length==0) { strErr+="处方内容不能为空!\\n"; } if(!PageValidate.IsNumber(txtP_Doctor.Text)) { strErr+="处方医生格式错误!\\n"; } if(!PageValidate.IsDateTime(txtP_Date.Text)) { strErr+="处方日期格式错误!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int PrescriptionID=int.Parse(this.lblPrescriptionID.Text); decimal P_Object=decimal.Parse(this.txtP_Object.Text); string P_Name=this.txtP_Name.Text; string P_Content=this.txtP_Content.Text; int P_Doctor=int.Parse(this.txtP_Doctor.Text); DateTime P_Date=DateTime.Parse(this.txtP_Date.Text); Maticsoft.Model.education_Prescription model=new Maticsoft.Model.education_Prescription(); model.PrescriptionID=PrescriptionID; model.P_Object=P_Object; model.P_Name=P_Name; model.P_Content=P_Content; model.P_Doctor=P_Doctor; model.P_Date=P_Date; Maticsoft.BLL.education_Prescription bll=new Maticsoft.BLL.education_Prescription(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx"); }
/// <summary> /// 绑定列表数据 /// </summary> private void BindData() { string orderby = OrderType == 0 ? Orderfld + " asc" : Orderfld + " desc"; int startIndex = (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize + 1; int endIndex = this.AspNetPager1.CurrentPageIndex * this.AspNetPager1.PageSize; Maticsoft.BLL.education_Prescription bll = new Maticsoft.BLL.education_Prescription(); DataSet datas = bll.GetListByPage(SearchTerms, orderby, startIndex, endIndex); GridView1.DataSource = datas; GridView1.DataBind(); this.AspNetPager1.RecordCount = bll.GetRecordCount(SearchTerms); }
/// <summary> /// 在编辑的时候将对应的值绑定到Label上 /// </summary> private void InputData() { Maticsoft.BLL.education_Prescription bll = new Maticsoft.BLL.education_Prescription(); Maticsoft.Model.education_Prescription model = bll.GetModel(PrescriptionID); P_Date.Text = model.P_Date.ToShortDateString(); P_Content.Text = model.P_Content; P_Name.Text = model.P_Name; Maticsoft.BLL.sys_User user_bll = new Maticsoft.BLL.sys_User(); Maticsoft.Model.sys_User user_model1 = user_bll.GetModel(model.P_Object); P_Object.Value = user_model1.UserID + ""; P_Object_input.Text = user_model1.U_CName; Maticsoft.Model.sys_User user_model2 = user_bll.GetModel(model.P_Doctor); P_Doctor.Value = user_model2.UserID + ""; P_Doctor_input.Text = user_model2.U_CName; }
/// <summary> /// 初始化 /// </summary> private void OnStart() { if (CMD == "New") { } else if (CMD == "Edit") { HeadMenuButtonItem bi2 = new HeadMenuButtonItem(); bi2.ButtonPopedom = PopedomType.Delete; bi2.ButtonName = "健康教育处方"; bi2.ButtonUrlType = UrlType.JavaScript; bi2.ButtonUrl = string.Format("DelData('?CMD=Delete&PrescriptionID={0}')", PrescriptionID); HeadMenuWebControls1.ButtonList.Add(bi2); InputData(); } else if (CMD == "Delete") { Maticsoft.BLL.education_Prescription bll = new Maticsoft.BLL.education_Prescription(); Maticsoft.Model.education_Prescription model = bll.GetModel(PrescriptionID); bll.Delete(model.PrescriptionID); EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", PrescriptionID, "删除信息"), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); } }