/// <summary> /// 点击确定按钮执行的方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { Maticsoft.BLL.supervision_Info supervision = new Maticsoft.BLL.supervision_Info(); Maticsoft.Model.supervision_Info supervision_Info = supervision.GetModel(InfoID); if (supervision_Info == null) { supervision_Info = new Maticsoft.Model.supervision_Info(); } //获取客户端通过Post方式传递过来的值的(需要更改) supervision_Info.I_FindDate = (DateTime)Common.sink(this.I_FindDate.UniqueID, MethodType.Post, 255, 0, DataType.Dat); supervision_Info.I_Type = Convert.ToInt32(this.I_Type.SelectedValue); supervision_Info.I_Content = (string)Common.sink(this.I_Content.UniqueID, MethodType.Post, 0, 0, DataType.Str); supervision_Info.I_ReportDate = (DateTime)Common.sink(this.I_ReportDate.UniqueID, MethodType.Post, 0, 0, DataType.Dat); supervision_Info.I_ReportUserID = Convert.ToInt32(this.I_ReportUserID.Value); switch (CMD) { case "New": CMD_Txt = "增加"; //如果是增加操作,就调用Add方法 supervision.Add(supervision_Info); break; case "Edit": CMD_Txt = "修改"; //如果是修改操作,就调用Update方法 supervision.Update(supervision_Info); break; } All_Title_Txt = CMD_Txt + App_Txt; //以下方法的第4个参数需要更改 EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", InfoID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); }
/// <summary> /// 点击确定按钮执行的方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { Maticsoft.BLL.supervision_Info supervision = new Maticsoft.BLL.supervision_Info(); Maticsoft.Model.supervision_Info supervision_Info = supervision.GetModel(InfoID); if (supervision_Info == null) { supervision_Info = new Maticsoft.Model.supervision_Info(); } //获取客户端通过Post方式传递过来的值的(需要更改) supervision_Info.I_FindDate = (DateTime)Common.sink(this.I_FindDate.UniqueID, MethodType.Post, 255, 0, DataType.Dat); supervision_Info.I_Type = Convert.ToInt32(this.I_Type.SelectedValue); supervision_Info.I_Content = (string)Common.sink(this.I_Content.UniqueID, MethodType.Post, 0, 0, DataType.Str); supervision_Info.I_ReportDate = (DateTime)Common.sink(this.I_ReportDate.UniqueID, MethodType.Post, 0, 0, DataType.Dat); supervision_Info.I_ReportUserID = Convert.ToInt32(this.I_ReportUserID.Value); switch (CMD) { case "New": CMD_Txt = "增加"; //如果是增加操作,就调用Add方法 supervision.Add(supervision_Info); break; case "Edit": CMD_Txt = "修改"; //如果是修改操作,就调用Update方法 supervision.Update(supervision_Info); break; } All_Title_Txt = CMD_Txt + App_Txt; //以下方法的第4个参数需要更改 EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", InfoID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx")); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsDateTime(txtI_FindDate.Text)) { strErr += "发现时间格式错误!\\n"; } if (!PageValidate.IsNumber(txtI_Type.Text)) { strErr += "信息类别格式错误!\\n"; } if (this.txtI_Content.Text.Trim().Length == 0) { strErr += "信息内容不能为空!\\n"; } if (!PageValidate.IsDateTime(txtI_ReportDate.Text)) { strErr += "报告时间格式错误!\\n"; } if (!PageValidate.IsNumber(txtI_ReportUserID.Text)) { strErr += "报告人格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } DateTime I_FindDate = DateTime.Parse(this.txtI_FindDate.Text); int I_Type = int.Parse(this.txtI_Type.Text); string I_Content = this.txtI_Content.Text; DateTime I_ReportDate = DateTime.Parse(this.txtI_ReportDate.Text); int I_ReportUserID = int.Parse(this.txtI_ReportUserID.Text); Maticsoft.Model.supervision_Info model = new Maticsoft.Model.supervision_Info(); model.I_FindDate = I_FindDate; model.I_Type = I_Type; model.I_Content = I_Content; model.I_ReportDate = I_ReportDate; model.I_ReportUserID = I_ReportUserID; Maticsoft.BLL.supervision_Info bll = new Maticsoft.BLL.supervision_Info(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsDateTime(txtI_FindDate.Text)) { strErr+="发现时间格式错误!\\n"; } if(!PageValidate.IsNumber(txtI_Type.Text)) { strErr+="信息类别格式错误!\\n"; } if(this.txtI_Content.Text.Trim().Length==0) { strErr+="信息内容不能为空!\\n"; } if(!PageValidate.IsDateTime(txtI_ReportDate.Text)) { strErr+="报告时间格式错误!\\n"; } if(!PageValidate.IsNumber(txtI_ReportUserID.Text)) { strErr+="报告人格式错误!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } DateTime I_FindDate=DateTime.Parse(this.txtI_FindDate.Text); int I_Type=int.Parse(this.txtI_Type.Text); string I_Content=this.txtI_Content.Text; DateTime I_ReportDate=DateTime.Parse(this.txtI_ReportDate.Text); int I_ReportUserID=int.Parse(this.txtI_ReportUserID.Text); Maticsoft.Model.supervision_Info model=new Maticsoft.Model.supervision_Info(); model.I_FindDate=I_FindDate; model.I_Type=I_Type; model.I_Content=I_Content; model.I_ReportDate=I_ReportDate; model.I_ReportUserID=I_ReportUserID; Maticsoft.BLL.supervision_Info bll=new Maticsoft.BLL.supervision_Info(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx"); }