/// <summary> /// 点击确定按钮执行的方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { Maticsoft.BLL.AR_Report AR_Report_bll = new Maticsoft.BLL.AR_Report(); Maticsoft.Model.AR_Report AR_Report_model = AR_Report_bll.GetModel(ReportID); if (AR_Report_model == null) { AR_Report_model = new Maticsoft.Model.AR_Report(); } AR_Report_model.R_Type = 2; AR_Report_model.R_Title = R_Title.Text; AR_Report_model.R_Content = R_Content.Text; AR_Report_model.R_DateTime = DateTime.Now; AR_Report_model.R_ResponsibilityUserID = UserData.GetUserDate.UserID; //获取当前用户ID AR_Report_model.R_GroupID = UserData.GetUserDate.U_GroupID; switch (CMD) { case "New": CMD_Txt = "增加"; //如果是增加操作,就调用Add方法 AR_Report_model.ReportID = AR_Report_bll.Add(AR_Report_model); break; case "Edit": CMD_Txt = "修改"; //如果是修改操作,就调用Update方法 AR_Report_bll.Update(AR_Report_model); break; } All_Title_Txt = CMD_Txt + App_Txt; EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", AR_Report_model.ReportID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); }
protected void Button2_Click(object sender, EventArgs e) { Maticsoft.BLL.AR_Report AR_Report_bll = new Maticsoft.BLL.AR_Report(); Maticsoft.Model.AR_Report AR_Report_model = AR_Report_bll.GetModel(ReportID); AR_Report_model.R_ResponsibilityUserID = UserData.GetUserDate.UserID; //更改责任人 AR_Report_model.R_GroupID = UserData.GetUserDate.U_GroupID; //更改报告部门 CMD_Txt = "增加"; AR_Report_model.ReportID = AR_Report_bll.Add(AR_Report_model); All_Title_Txt = CMD_Txt + App_Txt; EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", AR_Report_model.ReportID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtR_Title.Text.Trim().Length == 0) { strErr += "报告标题不能为空!\\n"; } if (this.txtR_Content.Text.Trim().Length == 0) { strErr += "报告内容不能为空!\\n"; } if (!PageValidate.IsDateTime(txtR_DateTime.Text)) { strErr += "报告时间格式错误!\\n"; } if (!PageValidate.IsNumber(txtR_ResponsibilityUserID.Text)) { strErr += "责任人格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string R_Title = this.txtR_Title.Text; string R_Content = this.txtR_Content.Text; DateTime R_DateTime = DateTime.Parse(this.txtR_DateTime.Text); int R_ResponsibilityUserID = int.Parse(this.txtR_ResponsibilityUserID.Text); Maticsoft.Model.AR_Report model = new Maticsoft.Model.AR_Report(); model.R_Title = R_Title; model.R_Content = R_Content; model.R_DateTime = R_DateTime; model.R_ResponsibilityUserID = R_ResponsibilityUserID; Maticsoft.BLL.AR_Report bll = new Maticsoft.BLL.AR_Report(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(this.txtR_Title.Text.Trim().Length==0) { strErr+="报告标题不能为空!\\n"; } if(this.txtR_Content.Text.Trim().Length==0) { strErr+="报告内容不能为空!\\n"; } if(!PageValidate.IsDateTime(txtR_DateTime.Text)) { strErr+="报告时间格式错误!\\n"; } if(!PageValidate.IsNumber(txtR_ResponsibilityUserID.Text)) { strErr+="责任人格式错误!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } string R_Title=this.txtR_Title.Text; string R_Content=this.txtR_Content.Text; DateTime R_DateTime=DateTime.Parse(this.txtR_DateTime.Text); int R_ResponsibilityUserID=int.Parse(this.txtR_ResponsibilityUserID.Text); Maticsoft.Model.AR_Report model=new Maticsoft.Model.AR_Report(); model.R_Title=R_Title; model.R_Content=R_Content; model.R_DateTime=R_DateTime; model.R_ResponsibilityUserID=R_ResponsibilityUserID; Maticsoft.BLL.AR_Report bll=new Maticsoft.BLL.AR_Report(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx"); }