using BLL; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.HJGL.DataIn { public partial class DataInEdit : PageBase { #region 定义项 /// /// 临时表主键 /// public string TempId { get { return (string)ViewState["TempId"]; } set { ViewState["TempId"] = value; } } #endregion #region 加载页面 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.TempId = Request.Params["TempId"]; this.txtValue1.Focus(); var dataInTemp = BLL.DataInTempService.GetDataInTempByTempId(this.TempId); if (dataInTemp != null) { this.txtValue1.Text = dataInTemp.Value1; this.txtValue2.Text = dataInTemp.Value2; this.txtValue3.Text = dataInTemp.Value3; this.txtValue4.Text = dataInTemp.Value4; this.txtValue5.Text = dataInTemp.Value5; this.txtValue6.Text = dataInTemp.Value6; this.txtValue7.Text = dataInTemp.Value7; this.txtValue8.Text = dataInTemp.Value8; this.txtValue9.Text = dataInTemp.Value9; this.txtValue10.Text = dataInTemp.Value10; this.txtValue11.Text = dataInTemp.Value11; this.txtValue12.Text = dataInTemp.Value12; this.txtValue13.Text = dataInTemp.Value13; this.txtValue14.Text = dataInTemp.Value14; this.txtValue15.Text = dataInTemp.Value15; this.txtValue16.Text = dataInTemp.Value16; this.txtValue17.Text = dataInTemp.Value17; this.txtValue18.Text = dataInTemp.Value18; this.txtValue19.Text = dataInTemp.Value19; this.txtValue20.Text = dataInTemp.Value20; this.txtValue21.Text = dataInTemp.Value21; this.txtValue22.Text = dataInTemp.Value22; this.txtValue23.Text = dataInTemp.Value23; this.txtValue24.Text = dataInTemp.Value24; this.txtValue25.Text = dataInTemp.Value25; this.txtValue26.Text = dataInTemp.Value26; this.txtValue27.Text = dataInTemp.Value27; this.txtValue28.Text = dataInTemp.Value28; this.txtValue29.Text = dataInTemp.Value29; this.txtValue30.Text = dataInTemp.Value30; this.txtValue31.Text = dataInTemp.Value31; this.txtValue32.Text = dataInTemp.Value32; this.txtValue33.Text = dataInTemp.Value33; this.txtValue34.Text = dataInTemp.Value34; this.txtValue35.Text = dataInTemp.Value35; this.txtValue36.Text = dataInTemp.Value36; this.txtValue37.Text = dataInTemp.Value37; this.txtValue38.Text = dataInTemp.Value38; this.txtValue39.Text = dataInTemp.Value39; this.txtValue40.Text = dataInTemp.Value40; this.txtValue41.Text = dataInTemp.Value41; this.txtValue42.Text = dataInTemp.Value42; this.txtValue43.Text = dataInTemp.Value43; this.txtValue44.Text = dataInTemp.Value44; this.lbErrCout.Text = dataInTemp.ToopValue; } } } #endregion #region 保存按钮 /// /// 保存按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { if (!string.IsNullOrEmpty(this.TempId)) { var dataInTemp = db.Sys_DataInTemp.FirstOrDefault(x => x.TempId == this.TempId); if (dataInTemp != null) { if (this.ckAll.Checked) { var allDataInTemp = from x in db.Sys_DataInTemp where x.ProjectId == this.CurrUser.ProjectId && x.UserId == this.CurrUser.UserId && x.ToopValue != null select x; if (dataInTemp.Value1 != this.txtValue1.Text.Trim()) { var tempValue1 = allDataInTemp.Where(x => x.Value1 == dataInTemp.Value1 || (x.Value1 == null && dataInTemp.Value1 == null)); if (tempValue1 != null) { foreach (var item in tempValue1) { item.Value1 = this.txtValue1.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value2 != this.txtValue2.Text.Trim()) { var tempValue2 = allDataInTemp.Where(x => x.Value2 == dataInTemp.Value2 || (x.Value2 == null && dataInTemp.Value2 == null)); if (tempValue2 != null) { foreach (var item in tempValue2) { item.Value2 = this.txtValue2.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value3 != this.txtValue3.Text.Trim()) { var tempValue3 = allDataInTemp.Where(x => x.Value3 == dataInTemp.Value3 || (x.Value3 == null && dataInTemp.Value3 == null)); if (tempValue3 != null) { foreach (var item in tempValue3) { item.Value3 = this.txtValue3.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value5 != this.txtValue5.Text.Trim()) { var tempValue5 = allDataInTemp.Where(x => x.Value5 == dataInTemp.Value5 || (x.Value5 == null && dataInTemp.Value5 == null)); if (tempValue5 != null) { foreach (var item in tempValue5) { item.Value5 = this.txtValue5.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value6 != this.txtValue6.Text.Trim()) { var tempValue6 = allDataInTemp.Where(x => x.Value6 == dataInTemp.Value6 || (x.Value6 == null && dataInTemp.Value6 == null)); if (tempValue6 != null) { foreach (var item in tempValue6) { item.Value6 = this.txtValue6.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value7 != this.txtValue7.Text.Trim()) { var tempValue7 = allDataInTemp.Where(x => x.Value7 == dataInTemp.Value7 || (x.Value7 == null && dataInTemp.Value7 == null)); if (tempValue7 != null) { foreach (var item in tempValue7) { item.Value7 = this.txtValue7.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value8 != this.txtValue8.Text.Trim()) { var tempValue8 = allDataInTemp.Where(x => x.Value8 == dataInTemp.Value8 || (x.Value8 == null && dataInTemp.Value8 == null)); if (tempValue8 != null) { foreach (var item in tempValue8) { item.Value8 = this.txtValue8.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value9 != this.txtValue9.Text.Trim()) { var tempValue9 = allDataInTemp.Where(x => x.Value9 == dataInTemp.Value9 || (x.Value9 == null && dataInTemp.Value9 == null)); if (tempValue9 != null) { foreach (var item in tempValue9) { item.Value9 = this.txtValue9.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value10 != this.txtValue10.Text.Trim()) { var tempValue10 = allDataInTemp.Where(x => x.Value10 == dataInTemp.Value10 || (x.Value10 == null && dataInTemp.Value10 == null)); if (tempValue10 != null) { foreach (var item in tempValue10) { item.Value10 = this.txtValue10.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value11 != this.txtValue11.Text.Trim()) { var tempValue11 = allDataInTemp.Where(x => x.Value11 == dataInTemp.Value11 || (x.Value11 == null && dataInTemp.Value11 == null)); if (tempValue11 != null) { foreach (var item in tempValue11) { item.Value11 = this.txtValue11.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value12 != this.txtValue12.Text.Trim()) { var tempValue12 = allDataInTemp.Where(x => x.Value12 == dataInTemp.Value12 || (x.Value12 == null && dataInTemp.Value12 == null)); if (tempValue12 != null) { foreach (var item in tempValue12) { item.Value12 = this.txtValue12.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value13 != this.txtValue13.Text.Trim()) { var tempValue13 = allDataInTemp.Where(x => x.Value13 == dataInTemp.Value13 || (x.Value13 == null && dataInTemp.Value13 == null)); if (tempValue13 != null) { foreach (var item in tempValue13) { item.Value13 = this.txtValue13.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value14 != this.txtValue14.Text.Trim()) { var tempValue14 = allDataInTemp.Where(x => x.Value14 == dataInTemp.Value14 || (x.Value14 == null && dataInTemp.Value14 == null)); if (tempValue14 != null) { foreach (var item in tempValue14) { item.Value14 = this.txtValue14.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value15 != this.txtValue15.Text.Trim()) { var tempValue15 = allDataInTemp.Where(x => x.Value15 == dataInTemp.Value15 || (x.Value15 == null && dataInTemp.Value15 == null)); if (tempValue15 != null) { foreach (var item in tempValue15) { item.Value15 = this.txtValue15.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value16 != this.txtValue16.Text.Trim()) { var tempValue16 = allDataInTemp.Where(x => x.Value16 == dataInTemp.Value16 || (x.Value16 == null && dataInTemp.Value16 == null)); if (tempValue16 != null) { foreach (var item in tempValue16) { item.Value16 = this.txtValue16.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value17 != this.txtValue17.Text.Trim()) { var tempValue17 = allDataInTemp.Where(x => x.Value17 == dataInTemp.Value17 || (x.Value17 == null && dataInTemp.Value17 == null)); if (tempValue17 != null) { foreach (var item in tempValue17) { item.Value17 = this.txtValue17.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value18 != this.txtValue18.Text.Trim()) { var tempValue18 = allDataInTemp.Where(x => x.Value18 == dataInTemp.Value18 || (x.Value18 == null && dataInTemp.Value18 == null)); if (tempValue18 != null) { foreach (var item in tempValue18) { item.Value18 = this.txtValue18.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value19 != this.txtValue19.Text.Trim()) { var tempValue19 = allDataInTemp.Where(x => x.Value19 == dataInTemp.Value19 || (x.Value19 == null && dataInTemp.Value19 == null)); if (tempValue19 != null) { foreach (var item in tempValue19) { item.Value19 = this.txtValue19.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value20 != this.txtValue20.Text.Trim()) { var tempValue20 = allDataInTemp.Where(x => x.Value20 == dataInTemp.Value20 || (x.Value20 == null && dataInTemp.Value20 == null)); if (tempValue20 != null) { foreach (var item in tempValue20) { item.Value20 = this.txtValue20.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value21 != this.txtValue21.Text.Trim()) { var tempValue21 = allDataInTemp.Where(x => x.Value21 == dataInTemp.Value21 || (x.Value21 == null && dataInTemp.Value21 == null)); if (tempValue21 != null) { foreach (var item in tempValue21) { item.Value21 = this.txtValue21.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value22 != this.txtValue22.Text.Trim()) { var tempValue22 = allDataInTemp.Where(x => x.Value22 == dataInTemp.Value22 || (x.Value22 == null && dataInTemp.Value22 == null)); if (tempValue22 != null) { foreach (var item in tempValue22) { item.Value22 = this.txtValue22.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value23 != this.txtValue23.Text.Trim()) { var tempValue23 = allDataInTemp.Where(x => x.Value23 == dataInTemp.Value23 || (x.Value23 == null && dataInTemp.Value23 == null)); if (tempValue23 != null) { foreach (var item in tempValue23) { item.Value23 = this.txtValue23.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value24 != this.txtValue24.Text.Trim()) { var tempValue24 = allDataInTemp.Where(x => x.Value24 == dataInTemp.Value24 || (x.Value24 == null && dataInTemp.Value24 == null)); if (tempValue24 != null) { foreach (var item in tempValue24) { item.Value24 = this.txtValue24.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value25 != this.txtValue25.Text.Trim()) { var tempValue25 = allDataInTemp.Where(x => x.Value25 == dataInTemp.Value25 || (x.Value25 == null && dataInTemp.Value25 == null)); if (tempValue25 != null) { foreach (var item in tempValue25) { item.Value25 = this.txtValue25.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value26 != this.txtValue26.Text.Trim()) { var tempValue26 = allDataInTemp.Where(x => x.Value26 == dataInTemp.Value26 || (x.Value26 == null && dataInTemp.Value26 == null)); if (tempValue26 != null) { foreach (var item in tempValue26) { item.Value26 = this.txtValue26.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value27 != this.txtValue27.Text.Trim()) { var tempValue27 = allDataInTemp.Where(x => x.Value27 == dataInTemp.Value27 || (x.Value27 == null && dataInTemp.Value27 == null)); if (tempValue27 != null) { foreach (var item in tempValue27) { item.Value27 = this.txtValue27.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value28 != this.txtValue28.Text.Trim()) { var tempValue28 = allDataInTemp.Where(x => x.Value28 == dataInTemp.Value28 || (x.Value28 == null && dataInTemp.Value28 == null)); if (tempValue28 != null) { foreach (var item in tempValue28) { item.Value28 = this.txtValue28.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value29 != this.txtValue29.Text.Trim()) { var tempValue29 = allDataInTemp.Where(x => x.Value29 == dataInTemp.Value29 || (x.Value29 == null && dataInTemp.Value29 == null)); if (tempValue29 != null) { foreach (var item in tempValue29) { item.Value29 = this.txtValue29.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value30 != this.txtValue30.Text.Trim()) { var tempValue30 = allDataInTemp.Where(x => x.Value30 == dataInTemp.Value30 || (x.Value30 == null && dataInTemp.Value30 == null)); if (tempValue30 != null) { foreach (var item in tempValue30) { item.Value30 = this.txtValue30.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value31 != this.txtValue31.Text.Trim()) { var tempValue31 = allDataInTemp.Where(x => x.Value31 == dataInTemp.Value31 || (x.Value31 == null && dataInTemp.Value31 == null)); if (tempValue31 != null) { foreach (var item in tempValue31) { item.Value31 = this.txtValue31.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value32 != this.txtValue32.Text.Trim()) { var tempValue32 = allDataInTemp.Where(x => x.Value32 == dataInTemp.Value32 || (x.Value32 == null && dataInTemp.Value32 == null)); if (tempValue32 != null) { foreach (var item in tempValue32) { item.Value32 = this.txtValue32.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value33 != this.txtValue33.Text.Trim()) { var tempValue33 = allDataInTemp.Where(x => x.Value33 == dataInTemp.Value33 || (x.Value33 == null && dataInTemp.Value33 == null)); if (tempValue33 != null) { foreach (var item in tempValue33) { item.Value33 = this.txtValue33.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value34 != this.txtValue34.Text.Trim()) { var tempValue34 = allDataInTemp.Where(x => x.Value34 == dataInTemp.Value34 || (x.Value34 == null && dataInTemp.Value34 == null)); if (tempValue34 != null) { foreach (var item in tempValue34) { item.Value34 = this.txtValue34.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value35 != this.txtValue35.Text.Trim()) { var tempValue35 = allDataInTemp.Where(x => x.Value35 == dataInTemp.Value35 || (x.Value35 == null && dataInTemp.Value35 == null)); if (tempValue35 != null) { foreach (var item in tempValue35) { item.Value35 = this.txtValue35.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value36 != this.txtValue36.Text.Trim()) { var tempValue36 = allDataInTemp.Where(x => x.Value36 == dataInTemp.Value36 || (x.Value36 == null && dataInTemp.Value36 == null)); if (tempValue36 != null) { foreach (var item in tempValue36) { item.Value36 = this.txtValue36.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value37 != this.txtValue37.Text.Trim()) { var tempValue37 = allDataInTemp.Where(x => x.Value37 == dataInTemp.Value37 || (x.Value37 == null && dataInTemp.Value37 == null)); if (tempValue37 != null) { foreach (var item in tempValue37) { item.Value37 = this.txtValue37.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value38 != this.txtValue38.Text.Trim()) { var tempValue38 = allDataInTemp.Where(x => x.Value38 == dataInTemp.Value38 || (x.Value38 == null && dataInTemp.Value38 == null)); if (tempValue38 != null) { foreach (var item in tempValue38) { item.Value38 = this.txtValue38.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value39 != this.txtValue39.Text.Trim()) { var tempValue39 = allDataInTemp.Where(x => x.Value39 == dataInTemp.Value39 || (x.Value39 == null && dataInTemp.Value39 == null)); if (tempValue39 != null) { foreach (var item in tempValue39) { item.Value39 = this.txtValue39.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value40 != this.txtValue40.Text.Trim()) { var tempValue40 = allDataInTemp.Where(x => x.Value40 == dataInTemp.Value40 || (x.Value40 == null && dataInTemp.Value40 == null)); if (tempValue40 != null) { foreach (var item in tempValue40) { item.Value40 = this.txtValue40.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value41 != this.txtValue41.Text.Trim()) { var tempValue41 = allDataInTemp.Where(x => x.Value41 == dataInTemp.Value41 || (x.Value41 == null && dataInTemp.Value41 == null)); if (tempValue41 != null) { foreach (var item in tempValue41) { item.Value41 = this.txtValue41.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value42 != this.txtValue42.Text.Trim()) { var tempValue42 = allDataInTemp.Where(x => x.Value42 == dataInTemp.Value42 || (x.Value42 == null && dataInTemp.Value42 == null)); if (tempValue42 != null) { foreach (var item in tempValue42) { item.Value42 = this.txtValue42.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value43 != this.txtValue43.Text.Trim()) { var tempValue43 = allDataInTemp.Where(x => x.Value43 == dataInTemp.Value43 || (x.Value43 == null && dataInTemp.Value43 == null)); if (tempValue43 != null) { foreach (var item in tempValue43) { item.Value43 = this.txtValue43.Text.Trim(); db.SubmitChanges(); } } } if (dataInTemp.Value44 != this.txtValue44.Text.Trim()) { var tempValue44 = allDataInTemp.Where(x => x.Value44 == dataInTemp.Value44 || (x.Value44 == null && dataInTemp.Value44 == null)); if (tempValue44 != null) { foreach (var item in tempValue44) { item.Value44 = this.txtValue44.Text.Trim(); db.SubmitChanges(); } } } } dataInTemp.Value1 = this.txtValue1.Text.Trim(); dataInTemp.Value2 = this.txtValue2.Text.Trim(); dataInTemp.Value3 = this.txtValue3.Text.Trim(); dataInTemp.Value4 = this.txtValue4.Text.Trim(); dataInTemp.Value5 = this.txtValue5.Text.Trim(); dataInTemp.Value6 = this.txtValue6.Text.Trim(); dataInTemp.Value7 = this.txtValue7.Text.Trim(); dataInTemp.Value8 = this.txtValue8.Text.Trim(); dataInTemp.Value9 = this.txtValue9.Text.Trim(); dataInTemp.Value10 = this.txtValue10.Text.Trim(); dataInTemp.Value11 = this.txtValue11.Text.Trim(); dataInTemp.Value12 = this.txtValue12.Text.Trim(); dataInTemp.Value13 = this.txtValue13.Text.Trim(); dataInTemp.Value14 = this.txtValue14.Text.Trim(); dataInTemp.Value15 = this.txtValue15.Text.Trim(); dataInTemp.Value16 = this.txtValue16.Text.Trim(); dataInTemp.Value17 = this.txtValue17.Text.Trim(); dataInTemp.Value18 = this.txtValue18.Text.Trim(); dataInTemp.Value19 = this.txtValue19.Text.Trim(); dataInTemp.Value20 = this.txtValue20.Text.Trim(); dataInTemp.Value21 = this.txtValue21.Text.Trim(); dataInTemp.Value22 = this.txtValue22.Text.Trim(); dataInTemp.Value23 = this.txtValue23.Text.Trim(); dataInTemp.Value24 = this.txtValue24.Text.Trim(); dataInTemp.Value25 = this.txtValue25.Text.Trim(); dataInTemp.Value26 = this.txtValue26.Text.Trim(); dataInTemp.Value27 = this.txtValue27.Text.Trim(); dataInTemp.Value28 = this.txtValue28.Text.Trim(); dataInTemp.Value29 = this.txtValue29.Text.Trim(); dataInTemp.Value30 = this.txtValue30.Text.Trim(); dataInTemp.Value31 = this.txtValue31.Text.Trim(); dataInTemp.Value32 = this.txtValue32.Text.Trim(); dataInTemp.Value33 = this.txtValue33.Text.Trim(); dataInTemp.Value34 = this.txtValue34.Text.Trim(); dataInTemp.Value35 = this.txtValue35.Text.Trim(); dataInTemp.Value36 = this.txtValue36.Text.Trim(); dataInTemp.Value37 = this.txtValue37.Text.Trim(); dataInTemp.Value38 = this.txtValue38.Text.Trim(); dataInTemp.Value39 = this.txtValue39.Text.Trim(); dataInTemp.Value40 = this.txtValue40.Text.Trim(); dataInTemp.Value41 = this.txtValue41.Text.Trim(); dataInTemp.Value42 = this.txtValue42.Text.Trim(); dataInTemp.Value43 = this.txtValue43.Text.Trim(); dataInTemp.Value44 = this.txtValue44.Text.Trim(); dataInTemp.ToopValue = null; db.SubmitChanges(); } } ShowNotify("信息修改完成!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } } #endregion } }