From eaf3a114a822930e838d438873c46239219203cd Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Thu, 27 Feb 2025 16:05:25 +0800 Subject: [PATCH] 20250227 --- .../InspectionPersonDataInNew.aspx.cs | 44 +- .../ManageReportNew/MonthReportEdit.aspx.cs | 421 ++++++----- .../CQMS/ManageReportNew/WeekReportEdit.aspx | 2 +- .../ManageReportNew/WeekReportEdit.aspx.cs | 676 ++++++++++++++---- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 2 +- 5 files changed, 780 insertions(+), 365 deletions(-) diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNew.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNew.aspx.cs index d1fae42e..4459f2b8 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNew.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNew.aspx.cs @@ -345,12 +345,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive string errInfo = string.Empty; Model.Comprehensive_InspectionPerson Ins = new Model.Comprehensive_InspectionPerson(); - if (!string.IsNullOrEmpty(tempData.Value1)) + if (!string.IsNullOrEmpty(tempData.Value1.Trim())) { - var unit = units.FirstOrDefault(x => x.UnitName == tempData.Value1); + var unit = units.FirstOrDefault(x => x.UnitName == tempData.Value1.Trim()); if (unit == null) { - errInfo += "报验单位[" + tempData.Value1 + "]不存在;"; + errInfo += "报验单位[" + tempData.Value1.Trim() + "]不存在;"; } else { @@ -361,38 +361,38 @@ namespace FineUIPro.Web.CQMS.Comprehensive { errInfo += "报验单位为必填项;"; } - if (!string.IsNullOrEmpty(tempData.Value2)) + if (!string.IsNullOrEmpty(tempData.Value2.Trim())) { - Ins.InspectionPersonCode = tempData.Value2; + Ins.InspectionPersonCode = tempData.Value2.Trim(); } else { errInfo += "报验编号为必填项;"; } - if (!string.IsNullOrEmpty(tempData.Value3)) + if (!string.IsNullOrEmpty(tempData.Value3.Trim())) { - Ins.PersonName = tempData.Value3; + Ins.PersonName = tempData.Value3.Trim(); } else { errInfo += "姓名为必填项;"; } - if (!string.IsNullOrEmpty(tempData.Value4)) + if (!string.IsNullOrEmpty(tempData.Value4.Trim())) { - var cn = cns.Where(x => x.ProfessionalName == tempData.Value4).FirstOrDefault(); + var cn = cns.Where(x => x.ProfessionalName == tempData.Value4.Trim()).FirstOrDefault(); if (cn == null) { - errInfo += "专业名称[" + tempData.Value4 + "]不存在;"; + errInfo += "专业名称[" + tempData.Value4.Trim() + "]不存在;"; } else { Ins.CNProfessionalId = cn.CNProfessionalId; } } - if (!string.IsNullOrEmpty(tempData.Value5)) + if (!string.IsNullOrEmpty(tempData.Value5.Trim())) { string unitIds = string.Empty; - string[] reunit = tempData.Value5.Split(','); + string[] reunit = tempData.Value5.Trim().Split(','); foreach (string unitWork in reunit) { var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault(); @@ -415,14 +415,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive } if (!string.IsNullOrEmpty(tempData.Value6.Trim())) { - var post = Funs.DB.Base_Post.First(e => e.PostName == tempData.Value6.Trim()); + var post = posts.FirstOrDefault(e => e.PostName == tempData.Value6.Trim()); if (post != null) { Ins.PostId = post.PostId; } else { - errInfo += "工种[" + tempData.Value6 + "]不存在;"; + errInfo += "工种[" + tempData.Value6.Trim() + "]不存在;"; } } if (!string.IsNullOrEmpty(tempData.Value7.Trim())) @@ -463,15 +463,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive errInfo += "批准时间[" + tempData.Value10.Trim() + "]错误;"; } } - if (!string.IsNullOrEmpty(tempData.Value11)) + if (!string.IsNullOrEmpty(tempData.Value11.Trim())) { - if (tempData.Value11 != "是" && tempData.Value11 != "否") + if (tempData.Value11.Trim() != "是" && tempData.Value11.Trim() != "否") { - errInfo += "是否在场[" + tempData.Value11 + "]错误;"; + errInfo += "是否在场[" + tempData.Value11.Trim() + "]错误;"; } else { - Ins.IsOnSite = tempData.Value11 == "是" ? true : false; + Ins.IsOnSite = tempData.Value11.Trim() == "是" ? true : false; } } if (!string.IsNullOrEmpty(tempData.Value12.Trim())) @@ -504,15 +504,15 @@ namespace FineUIPro.Web.CQMS.Comprehensive { Ins.Remark = tempData.Value14.Trim(); } - if (!string.IsNullOrEmpty(tempData.Value15)) + if (!string.IsNullOrEmpty(tempData.Value15.Trim())) { try { - Ins.RemarkCode = Convert.ToInt32(tempData.Value15); + Ins.RemarkCode = Convert.ToInt32(tempData.Value15.Trim()); } catch (Exception) { - errInfo += "标志编号[" + tempData.Value15 + "]格式错误;"; + errInfo += "标志编号[" + tempData.Value15.Trim() + "]格式错误;"; } } else @@ -526,7 +526,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive { Ins.ProjectId = LoginProjectId; var isExitISOValue = oldViewInfos.FirstOrDefault(x => x.UnitId == Ins.UnitId - && x.RemarkCode == Funs.GetNewIntOrZero(tempData.Value15)); + && x.RemarkCode == Funs.GetNewIntOrZero(tempData.Value15.Trim())); if (isExitISOValue != null) ///已存在 { Ins.InspectionPersonId = isExitISOValue.InspectionPersonId; diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs index ce4cba8e..917d1479 100644 --- a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs @@ -2866,169 +2866,169 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } SaveMethod(); - ShowNotify("编辑成功!", MessageBoxIcon.Success); + ShowNotify("保存成功!", MessageBoxIcon.Success); //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); - Model.Report_WeekAndMonthReport_New weekAndMonthReport = WeekAndMonthReportNewService.Detail(this.ReportId); - if (weekAndMonthReport != null) - { - if (weekAndMonthReport.SortId != null) - { - this.txtPeriod.Text = Convert.ToString(weekAndMonthReport.SortId); - } - if (weekAndMonthReport.StartDate != null) - { - this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", weekAndMonthReport.StartDate); - } - if (weekAndMonthReport.EndDate != null) - { - this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", weekAndMonthReport.EndDate); - } - } - AddOrUpdate = "update"; + //Model.Report_WeekAndMonthReport_New weekAndMonthReport = WeekAndMonthReportNewService.Detail(this.ReportId); + //if (weekAndMonthReport != null) + //{ + // if (weekAndMonthReport.SortId != null) + // { + // this.txtPeriod.Text = Convert.ToString(weekAndMonthReport.SortId); + // } + // if (weekAndMonthReport.StartDate != null) + // { + // this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", weekAndMonthReport.StartDate); + // } + // if (weekAndMonthReport.EndDate != null) + // { + // this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", weekAndMonthReport.EndDate); + // } + //} + //AddOrUpdate = "update"; - #region 加载本月质量目标管理情况 - detailsGrid1.Clear(); - detailsGrid1 = (from x in db.Report_CqmsTarget - where x.ReportId == this.ReportId - orderby x.SortId - select x).ToList(); - if (detailsGrid1.Count > 0) - { - Grid1.Hidden = false; - Grid1.DataSource = detailsGrid1; - Grid1.DataBind(); - } + //#region 加载本月质量目标管理情况 + //detailsGrid1.Clear(); + //detailsGrid1 = (from x in db.Report_CqmsTarget + // where x.ReportId == this.ReportId + // orderby x.SortId + // select x).ToList(); + //if (detailsGrid1.Count > 0) + //{ + // Grid1.Hidden = false; + // Grid1.DataSource = detailsGrid1; + // Grid1.DataBind(); + //} - #endregion + //#endregion - #region 加载7.2 PQR/WPS报验情况 - var detailsGrid9 = (from x in db.Report_Construction_Plan - where x.ReportId == ReportId && x.ReType == "5" - select x).ToList(); - if (detailsGrid9.Count > 0) - { - Grid9.Hidden = false; - Grid9.DataSource = detailsGrid9; - Grid9.DataBind(); - } - if (!string.IsNullOrEmpty(Request.Params["view"])) - { - //查看页面 - Button4.Hidden = true; - Button3.Hidden = true; - //合计 - OutPutSummaryGrid9(); - Grid1.FindColumn("Delete1").Hidden = true; - Grid9.FindColumn("Delete9").Hidden = true; - } - #endregion + //#region 加载7.2 PQR/WPS报验情况 + //var detailsGrid9 = (from x in db.Report_Construction_Plan + // where x.ReportId == ReportId && x.ReType == "5" + // select x).ToList(); + //if (detailsGrid9.Count > 0) + //{ + // Grid9.Hidden = false; + // Grid9.DataSource = detailsGrid9; + // Grid9.DataBind(); + //} + //if (!string.IsNullOrEmpty(Request.Params["view"])) + //{ + // //查看页面 + // Button4.Hidden = true; + // Button3.Hidden = true; + // //合计 + // OutPutSummaryGrid9(); + // Grid1.FindColumn("Delete1").Hidden = true; + // Grid9.FindColumn("Delete9").Hidden = true; + //} + //#endregion - #region 加载18.本月质量问题处理情况 - //(1)原材料问题 - rowMaterialProblemLists.Clear(); - rowMaterialProblemLists = (from x in db.Report_RowMaterialProblem - where x.ReportId == this.ReportId - select x).ToList(); - if (rowMaterialProblemLists.Count > 0) - { - gvRowMaterialProblem.Hidden = false; - gvRowMaterialProblem.DataSource = rowMaterialProblemLists; - gvRowMaterialProblem.DataBind(); - } - //(2)施工过程问题 - constructionProblemsLists.Clear(); - constructionProblemsLists = (from x in db.Report_ConstructionProblems - where x.ReportId == this.ReportId - select x).ToList(); - if (constructionProblemsLists.Count > 0) - { - gvConstructionProblems.Hidden = false; - gvConstructionProblems.DataSource = constructionProblemsLists; - gvConstructionProblems.DataBind(); - } - #endregion + //#region 加载18.本月质量问题处理情况 + ////(1)原材料问题 + //rowMaterialProblemLists.Clear(); + //rowMaterialProblemLists = (from x in db.Report_RowMaterialProblem + // where x.ReportId == this.ReportId + // select x).ToList(); + //if (rowMaterialProblemLists.Count > 0) + //{ + // gvRowMaterialProblem.Hidden = false; + // gvRowMaterialProblem.DataSource = rowMaterialProblemLists; + // gvRowMaterialProblem.DataBind(); + //} + ////(2)施工过程问题 + //constructionProblemsLists.Clear(); + //constructionProblemsLists = (from x in db.Report_ConstructionProblems + // where x.ReportId == this.ReportId + // select x).ToList(); + //if (constructionProblemsLists.Count > 0) + //{ + // gvConstructionProblems.Hidden = false; + // gvConstructionProblems.DataSource = constructionProblemsLists; + // gvConstructionProblems.DataBind(); + //} + //#endregion - #region 加载19.下月质量控制重点 - nextQualityControlLists.Clear(); - nextQualityControlLists = (from x in db.Report_NextQualityControl - where x.ReportId == this.ReportId - select x).ToList(); - if (nextQualityControlLists.Count > 0) - { - gvNextQualityControl.Hidden = false; - gvNextQualityControl.DataSource = nextQualityControlLists; - gvNextQualityControl.DataBind(); - } - #endregion + //#region 加载19.下月质量控制重点 + //nextQualityControlLists.Clear(); + //nextQualityControlLists = (from x in db.Report_NextQualityControl + // where x.ReportId == this.ReportId + // select x).ToList(); + //if (nextQualityControlLists.Count > 0) + //{ + // gvNextQualityControl.Hidden = false; + // gvNextQualityControl.DataSource = nextQualityControlLists; + // gvNextQualityControl.DataBind(); + //} + //#endregion - #region 加载文本框内容 - var txtReportList = db.Report_TextBoxContent.Where(x => x.ReportId == ReportId).ToList(); - if (txtReportList.Count > 0) - { - if (txtReportList.FirstOrDefault(x => x.ContentType == "0") != null) - { - txtAre0.Text = txtReportList.FirstOrDefault(x => x.ContentType == "0").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "1") != null) - { - txtAre1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "1").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "2") != null) - { - txtAre2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "2").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "20") != null) - { - txtAre20.Text = txtReportList.FirstOrDefault(x => x.ContentType == "20").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "21") != null) - { - txtAre21.Text = txtReportList.FirstOrDefault(x => x.ContentType == "21").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "22") != null) - { - txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "8") != null) - { - txtAre8.Text = txtReportList.FirstOrDefault(x => x.ContentType == "8").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "23-1") != null) - { - imgPhoto.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl; - txtPhotoContent1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "23-2") != null) - { - imgPhoto2.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl; - txtPhotoContent2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "23-3") != null) - { - imgPhoto3.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl; - txtPhotoContent3.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "23-4") != null) - { - imgPhoto4.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl; - txtPhotoContent4.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "23-5") != null) - { - imgPhoto5.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl; - txtPhotoContent5.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText; - } - if (txtReportList.FirstOrDefault(x => x.ContentType == "23-6") != null) - { - imgPhoto6.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl; - txtPhotoContent6.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText; - } - } - #endregion + //#region 加载文本框内容 + //var txtReportList = db.Report_TextBoxContent.Where(x => x.ReportId == ReportId).ToList(); + //if (txtReportList.Count > 0) + //{ + // if (txtReportList.FirstOrDefault(x => x.ContentType == "0") != null) + // { + // txtAre0.Text = txtReportList.FirstOrDefault(x => x.ContentType == "0").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "1") != null) + // { + // txtAre1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "1").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "2") != null) + // { + // txtAre2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "2").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "20") != null) + // { + // txtAre20.Text = txtReportList.FirstOrDefault(x => x.ContentType == "20").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "21") != null) + // { + // txtAre21.Text = txtReportList.FirstOrDefault(x => x.ContentType == "21").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "22") != null) + // { + // txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "8") != null) + // { + // txtAre8.Text = txtReportList.FirstOrDefault(x => x.ContentType == "8").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "23-1") != null) + // { + // imgPhoto.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl; + // txtPhotoContent1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "23-2") != null) + // { + // imgPhoto2.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl; + // txtPhotoContent2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "23-3") != null) + // { + // imgPhoto3.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl; + // txtPhotoContent3.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "23-4") != null) + // { + // imgPhoto4.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl; + // txtPhotoContent4.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "23-5") != null) + // { + // imgPhoto5.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl; + // txtPhotoContent5.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText; + // } + // if (txtReportList.FirstOrDefault(x => x.ContentType == "23-6") != null) + // { + // imgPhoto6.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl; + // txtPhotoContent6.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText; + // } + //} + //#endregion - //加载所有grid - lodAllGrid("1"); + ////加载所有grid + //lodAllGrid("1"); } private void SaveMethod() @@ -3167,6 +3167,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew Model.Report_CqmsTarget newDetail = new Model.Report_CqmsTarget { //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ProStage = values.Value("ProStage"), ProDescribe = values.Value("ProDescribe"), @@ -3175,10 +3176,10 @@ namespace FineUIPro.Web.CQMS.ManageReportNew Remarks = values.Value("Remarks"), SortId = rowIndex + 1 }; - if (Grid1.Rows[rowIndex].DataKeys.Length > 0) - { - newDetail.Id = Grid1.Rows[rowIndex].DataKeys[0].ToString(); - } + //if (Grid1.Rows[rowIndex].DataKeys.Length > 0) + //{ + // newDetail.Id = Grid1.Rows[rowIndex].DataKeys[0].ToString(); + //} detailLists.Add(newDetail); } if (detailLists.Count > 0) @@ -3208,7 +3209,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "5", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3252,7 +3254,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "0", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3294,7 +3297,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "1", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3337,7 +3341,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "2", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3381,7 +3386,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "3", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3425,7 +3431,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "4", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3469,7 +3476,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "6", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3509,42 +3517,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew var txtContentList = new List(); #region 给实体赋值 var model0 = new Model.Report_TextBoxContent(); - model0.Id = Guid.NewGuid().ToString(); + model0.Id = SQLHelper.GetNewID(); model0.ReportId = ReportId; model0.ContentType = "0"; model0.ContentText = txtAre0.Text; txtContentList.Add(model0); var model1 = new Model.Report_TextBoxContent(); - model1.Id = Guid.NewGuid().ToString(); + model1.Id = SQLHelper.GetNewID(); model1.ReportId = ReportId; model1.ContentType = "1"; model1.ContentText = txtAre1.Text; txtContentList.Add(model1); var model2 = new Model.Report_TextBoxContent(); - model2.Id = Guid.NewGuid().ToString(); + model2.Id = SQLHelper.GetNewID(); model2.ReportId = ReportId; model2.ContentType = "2"; model2.ContentText = txtAre2.Text; txtContentList.Add(model2); var model20 = new Model.Report_TextBoxContent(); - model20.Id = Guid.NewGuid().ToString(); + model20.Id = SQLHelper.GetNewID(); model20.ReportId = ReportId; model20.ContentType = "20"; model20.ContentText = txtAre20.Text; txtContentList.Add(model20); var model21 = new Model.Report_TextBoxContent(); - model21.Id = Guid.NewGuid().ToString(); + model21.Id = SQLHelper.GetNewID(); model21.ReportId = ReportId; model21.ContentType = "21"; model21.ContentText = txtAre21.Text; txtContentList.Add(model21); var model22 = new Model.Report_TextBoxContent(); - model22.Id = Guid.NewGuid().ToString(); + model22.Id = SQLHelper.GetNewID(); model22.ReportId = ReportId; model22.ContentType = "22"; model22.ContentText = txtAre22.Text; @@ -3552,7 +3560,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //如果8设备材料报验管理情况点击了增加按钮,则添加文本框内容 var model8 = new Model.Report_TextBoxContent(); - model8.Id = Guid.NewGuid().ToString(); + model8.Id = SQLHelper.GetNewID(); model8.ReportId = ReportId; model8.ContentType = "8"; model8.ContentText = txtAre8.Text; @@ -3582,7 +3590,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id= SQLHelper.GetNewID(), ReportId = ReportId, ReType = "9", ContentName = values.Value("ContentName"), @@ -3624,7 +3633,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-1", ContentName = values.Value("WorkName"), @@ -3665,7 +3675,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-2", ContentName = values.Value("WorkName"), @@ -3706,7 +3717,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-3", ContentName = values.Value("WorkName"), @@ -3748,7 +3760,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-4", ContentName = values.Value("WorkName"), @@ -3791,7 +3804,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-5", ContentName = values.Value("WorkName"), @@ -3834,7 +3848,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-6", ContentName = values.Value("WorkName"), @@ -3877,7 +3892,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-7", ContentName = values.Value("WorkName"), @@ -3920,7 +3936,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10", ContentName = values.Value("WorkName"), @@ -3968,7 +3985,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "11", TotalNoBackCount = Funs.GetNewIntOrZero(values.Value("TotalNoBackCount")), @@ -4011,7 +4029,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "12", TotalNoBackCount = Funs.GetNewIntOrZero(values.Value("TotalNoBackCount")), @@ -4055,7 +4074,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "13", TotalNoBackCount = Funs.GetNewIntOrZero(values.Value("TotalNoBackCount")), @@ -4098,7 +4118,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "14", ContentName = values.Value("WorkName"), @@ -4143,7 +4164,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "1", ContentName = values.Value("ContentName"), @@ -4188,7 +4210,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "2", ContentName = values.Value("ContentName"), @@ -4232,7 +4255,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "3", ContentName = values.Value("ContentName"), @@ -4277,7 +4301,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_RowMaterialProblem newDetail = new Model.Report_RowMaterialProblem { - RowMaterialProblemId = values.Value("RowMaterialProblemId"), + //RowMaterialProblemId = values.Value("RowMaterialProblemId"), + RowMaterialProblemId = SQLHelper.GetNewID(), ReportId = ReportId, UnitId = values.Value("UnitId"), ProblemDesrioption = values.Value("ProblemDesrioption"), @@ -4320,7 +4345,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_ConstructionProblems newDetail = new Model.Report_ConstructionProblems { - ConstructionProblemsId = values.Value("ConstructionProblemsId"), + //ConstructionProblemsId = values.Value("ConstructionProblemsId"), + ConstructionProblemsId= SQLHelper.GetNewID(), ReportId = ReportId, UnitId = values.Value("UnitId"), ProblemDesrioption = values.Value("ProblemDesrioption"), @@ -4365,7 +4391,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_NextQualityControl newDetail = new Model.Report_NextQualityControl { - NextQualityControlId = values.Value("NextQualityControlId"), + //NextQualityControlId = values.Value("NextQualityControlId"), + NextQualityControlId= SQLHelper.GetNewID(), ReportId = ReportId, NextQualityControlContent = values.Value("NextQualityControlContent") }; @@ -4396,7 +4423,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew { var ImageLists = new List(); var imgage1 = new Model.Report_TextBoxContent(); - imgage1.Id = Guid.NewGuid().ToString(); + imgage1.Id = SQLHelper.GetNewID(); imgage1.ReportId = ReportId; imgage1.ContentType = "23-1"; imgage1.ContentText = txtPhotoContent1.Text; @@ -4404,7 +4431,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage1); var imgage2 = new Model.Report_TextBoxContent(); - imgage2.Id = Guid.NewGuid().ToString(); + imgage2.Id = SQLHelper.GetNewID(); imgage2.ReportId = ReportId; imgage2.ContentType = "23-2"; imgage2.ContentText = txtPhotoContent2.Text; @@ -4412,7 +4439,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage2); var imgage3 = new Model.Report_TextBoxContent(); - imgage3.Id = Guid.NewGuid().ToString(); + imgage3.Id = SQLHelper.GetNewID(); imgage3.ReportId = ReportId; imgage3.ContentType = "23-3"; imgage3.ContentText = txtPhotoContent3.Text; @@ -4420,7 +4447,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage3); var imgage4 = new Model.Report_TextBoxContent(); - imgage4.Id = Guid.NewGuid().ToString(); + imgage4.Id = SQLHelper.GetNewID(); imgage4.ReportId = ReportId; imgage4.ContentType = "23-4"; imgage4.ContentText = txtPhotoContent4.Text; @@ -4428,7 +4455,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage4); var imgage5 = new Model.Report_TextBoxContent(); - imgage5.Id = Guid.NewGuid().ToString(); + imgage5.Id = SQLHelper.GetNewID(); imgage5.ReportId = ReportId; imgage5.ContentType = "23-5"; imgage5.ContentText = txtPhotoContent5.Text; @@ -4436,7 +4463,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage5); var imgage6 = new Model.Report_TextBoxContent(); - imgage6.Id = Guid.NewGuid().ToString(); + imgage6.Id = SQLHelper.GetNewID(); imgage6.ReportId = ReportId; imgage6.ContentType = "23-6"; imgage6.ContentText = txtPhotoContent6.Text; diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/WeekReportEdit.aspx b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/WeekReportEdit.aspx index 1e669722..afd22cdb 100644 --- a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/WeekReportEdit.aspx +++ b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/WeekReportEdit.aspx @@ -78,7 +78,7 @@ bordercolor="#bcd2e7" bordercolordark="#bcd2e7" bordercolorlight="#bcd2e7"> - + diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/WeekReportEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/WeekReportEdit.aspx.cs index 2dfc624b..5f89f97b 100644 --- a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/WeekReportEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/WeekReportEdit.aspx.cs @@ -232,18 +232,36 @@ namespace FineUIPro.Web.CQMS.ManageReportNew txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText; txtAre8.Text = txtReportList.FirstOrDefault(x => x.ContentType == "8").ContentText; - imgPhoto.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl; - txtPhotoContent1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText; - imgPhoto2.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl; - txtPhotoContent2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText; - imgPhoto3.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl; - txtPhotoContent3.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText; - imgPhoto4.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl; - txtPhotoContent4.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText; - imgPhoto5.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl; - txtPhotoContent5.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText; - imgPhoto6.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl; - txtPhotoContent6.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText; + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-1") != null) + { + imgPhoto.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl; + txtPhotoContent1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-2") != null) + { + imgPhoto2.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl; + txtPhotoContent2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-3") != null) + { + imgPhoto3.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl; + txtPhotoContent3.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-4") != null) + { + imgPhoto4.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl; + txtPhotoContent4.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-5") != null) + { + imgPhoto5.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl; + txtPhotoContent5.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-6") != null) + { + imgPhoto6.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl; + txtPhotoContent6.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText; + } } #endregion @@ -2798,6 +2816,148 @@ namespace FineUIPro.Web.CQMS.ManageReportNew SaveMethod(); ShowNotify("保存成功!", MessageBoxIcon.Success); //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + + Model.Report_WeekAndMonthReport_New weekAndMonthReport = WeekAndMonthReportNewService.Detail(this.ReportId); + if (weekAndMonthReport != null) + { + if (weekAndMonthReport.SortId != null) + { + this.txtPeriod.Text = Convert.ToString(weekAndMonthReport.SortId); + } + if (weekAndMonthReport.StartDate != null) + { + this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", weekAndMonthReport.StartDate); + } + if (weekAndMonthReport.EndDate != null) + { + this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", weekAndMonthReport.EndDate); + } + } + AddOrUpdate = "update"; + + #region 加载本月质量目标管理情况 + detailsGrid1.Clear(); + detailsGrid1 = (from x in db.Report_CqmsTarget + where x.ReportId == this.ReportId + orderby x.SortId + select x).ToList(); + if (detailsGrid1.Count > 0) + { + Grid1.Hidden = false; + Grid1.DataSource = detailsGrid1; + Grid1.DataBind(); + } + + #endregion + + #region 加载7.2 PQR/WPS报验情况 + var detailsGrid9 = (from x in db.Report_Construction_Plan + where x.ReportId == ReportId && x.ReType == "5" + select x).ToList(); + if (detailsGrid9.Count > 0) + { + Grid9.Hidden = false; + Grid9.DataSource = detailsGrid9; + Grid9.DataBind(); + } + if (!string.IsNullOrEmpty(Request.Params["view"])) + { + //查看页面 + Button4.Hidden = true; + Button3.Hidden = true; + //合计 + OutPutSummaryGrid9(); + Grid1.FindColumn("Delete1").Hidden = true; + Grid9.FindColumn("Delete9").Hidden = true; + } + #endregion + + #region 加载18.本月质量问题处理情况 + //(1)原材料问题 + rowMaterialProblemLists.Clear(); + rowMaterialProblemLists = (from x in db.Report_RowMaterialProblem + where x.ReportId == this.ReportId + select x).ToList(); + if (rowMaterialProblemLists.Count > 0) + { + gvRowMaterialProblem.Hidden = false; + gvRowMaterialProblem.DataSource = rowMaterialProblemLists; + gvRowMaterialProblem.DataBind(); + } + //(2)施工过程问题 + constructionProblemsLists.Clear(); + constructionProblemsLists = (from x in db.Report_ConstructionProblems + where x.ReportId == this.ReportId + select x).ToList(); + if (constructionProblemsLists.Count > 0) + { + gvConstructionProblems.Hidden = false; + gvConstructionProblems.DataSource = constructionProblemsLists; + gvConstructionProblems.DataBind(); + } + #endregion + + #region 加载19.下月质量控制重点 + nextQualityControlLists.Clear(); + nextQualityControlLists = (from x in db.Report_NextQualityControl + where x.ReportId == this.ReportId + select x).ToList(); + if (nextQualityControlLists.Count > 0) + { + gvNextQualityControl.Hidden = false; + gvNextQualityControl.DataSource = nextQualityControlLists; + gvNextQualityControl.DataBind(); + } + #endregion + + #region 加载文本框内容 + var txtReportList = db.Report_TextBoxContent.Where(x => x.ReportId == ReportId).ToList(); + if (txtReportList.Count > 0) + { + txtAre0.Text = txtReportList.FirstOrDefault(x => x.ContentType == "0").ContentText; + txtAre1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "1").ContentText; + txtAre2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "2").ContentText; + + txtAre20.Text = txtReportList.FirstOrDefault(x => x.ContentType == "20").ContentText; + txtAre21.Text = txtReportList.FirstOrDefault(x => x.ContentType == "21").ContentText; + txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText; + txtAre8.Text = txtReportList.FirstOrDefault(x => x.ContentType == "8").ContentText; + + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-1") != null) + { + imgPhoto.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl; + txtPhotoContent1.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-2") != null) + { + imgPhoto2.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl; + txtPhotoContent2.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-3") != null) + { + imgPhoto3.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl; + txtPhotoContent3.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-4") != null) + { + imgPhoto4.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl; + txtPhotoContent4.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-5") != null) + { + imgPhoto5.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl; + txtPhotoContent5.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText; + } + if (txtReportList.FirstOrDefault(x => x.ContentType == "23-6") != null) + { + imgPhoto6.ImageUrl = "~/" + txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl; + txtPhotoContent6.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText; + } + } + #endregion + + //加载所有grid + lodAllGrid("1"); } #region 保存方法 @@ -2838,7 +2998,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //CqmsTargetService.Delete(ReportId); //所有文本框表 - TextBoxContentService.Delete(ReportId); + //TextBoxContentService.Delete(ReportId); //删除施工方案及检验试验计划审批情况 //BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId); @@ -2933,7 +3093,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #region 保存本月质量目标管理情况 void saveTarget() { - CqmsTargetService.Delete(ReportId); List detailLists = new List(); JArray teamGroupData = Grid1.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -2942,7 +3101,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int rowIndex = teamGroupRow.Value("index"); Model.Report_CqmsTarget newDetail = new Model.Report_CqmsTarget { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ProStage = values.Value("ProStage"), ProDescribe = values.Value("ProDescribe"), @@ -2959,8 +3119,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CqmsTarget.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + CqmsTargetService.Delete(ReportId); + db.Report_CqmsTarget.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -2968,7 +3136,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #region 保存PQR/WPS报验情况 void savePqrWps() { - BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "5"); List detailLists = new List(); JArray teamGroupData = Grid9.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -2977,7 +3144,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "5", UnitOrMajor = values.Value("UnitOrMajor"), @@ -2993,8 +3161,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "5"); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3005,7 +3181,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveYbsgfa() { - BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "0"); List detailLists = new List(); JArray teamGroupData = Grid2.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3014,7 +3189,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "0", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3030,8 +3206,17 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "0"); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } + } } @@ -3040,7 +3225,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveWdgcfa() { - BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "1"); List detailLists = new List(); JArray teamGroupData = Grid3.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3049,7 +3233,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "1", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3066,8 +3251,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "1"); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } @@ -3076,7 +3269,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveJysyjh() { - BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "2"); List detailLists = new List(); JArray teamGroupData = Grid4.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3085,7 +3277,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "2", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3101,8 +3294,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "2"); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3113,7 +3314,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveSjjd() { - BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "3"); List detailLists = new List(); JArray teamGroupData = Grid5.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3122,7 +3322,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "3", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3138,8 +3339,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "3"); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3150,7 +3359,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveTzhs() { - BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "4"); List detailLists = new List(); JArray teamGroupData = Grid6.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3159,7 +3367,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "4", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3175,8 +3384,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "4"); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3187,7 +3404,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveSbclBy() { - BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "6"); List detailLists = new List(); JArray teamGroupData = Grid11.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3196,7 +3412,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_Construction_Plan newDetail = new Model.Report_Construction_Plan { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "6", UnitOrMajor = values.Value("UnitOrMajor"), @@ -3213,8 +3430,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.CQMS.ManageReport.ReportNew.ConstructionPlanService.Delete(ReportId, "6"); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3228,42 +3453,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew var txtContentList = new List(); #region 给实体赋值 var model0 = new Model.Report_TextBoxContent(); - model0.Id = Guid.NewGuid().ToString(); + model0.Id = SQLHelper.GetNewID(); model0.ReportId = ReportId; model0.ContentType = "0"; model0.ContentText = txtAre0.Text; txtContentList.Add(model0); var model1 = new Model.Report_TextBoxContent(); - model1.Id = Guid.NewGuid().ToString(); + model1.Id = SQLHelper.GetNewID(); model1.ReportId = ReportId; model1.ContentType = "1"; model1.ContentText = txtAre1.Text; txtContentList.Add(model1); var model2 = new Model.Report_TextBoxContent(); - model2.Id = Guid.NewGuid().ToString(); + model2.Id = SQLHelper.GetNewID(); model2.ReportId = ReportId; model2.ContentType = "2"; model2.ContentText = txtAre2.Text; txtContentList.Add(model2); var model20 = new Model.Report_TextBoxContent(); - model20.Id = Guid.NewGuid().ToString(); + model20.Id = SQLHelper.GetNewID(); model20.ReportId = ReportId; model20.ContentType = "20"; model20.ContentText = txtAre20.Text; txtContentList.Add(model20); var model21 = new Model.Report_TextBoxContent(); - model21.Id = Guid.NewGuid().ToString(); + model21.Id = SQLHelper.GetNewID(); model21.ReportId = ReportId; model21.ContentType = "21"; model21.ContentText = txtAre21.Text; txtContentList.Add(model21); var model22 = new Model.Report_TextBoxContent(); - model22.Id = Guid.NewGuid().ToString(); + model22.Id = SQLHelper.GetNewID(); model22.ReportId = ReportId; model22.ContentType = "22"; model22.ContentText = txtAre22.Text; @@ -3271,21 +3496,28 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //如果8设备材料报验管理情况点击了增加按钮,则添加文本框内容 var model8 = new Model.Report_TextBoxContent(); - model8.Id = Guid.NewGuid().ToString(); + model8.Id = SQLHelper.GetNewID(); model8.ReportId = ReportId; model8.ContentType = "8"; model8.ContentText = txtAre8.Text; txtContentList.Add(model8); #endregion - db.Report_TextBoxContent.InsertAllOnSubmit(txtContentList); - db.SubmitChanges(); + try + { + TextBoxContentService.Delete(ReportId); + db.Report_TextBoxContent.InsertAllOnSubmit(txtContentList); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } #endregion #region 9.计量器具报验管理情况 void saveMeasuringInspection() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "9"); List detailLists = new List(); JArray teamGroupData = gvMeasuringInspection.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3294,7 +3526,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "9", ContentName = values.Value("ContentName"), @@ -3311,8 +3544,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "9"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3320,7 +3561,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #region 10.现场质量共检数据 void saveTjInspection() //检验批统计:土建 { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-1"); List detailLists = new List(); JArray teamGroupData = gvTj.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3329,7 +3569,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-1", ContentName = values.Value("WorkName"), @@ -3351,13 +3592,20 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-1"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } void saveSbInspection() //检验批统计:设备 - { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-2"); + { List detailLists = new List(); JArray teamGroupData = GvSb.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3366,7 +3614,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-2", ContentName = values.Value("WorkName"), @@ -3387,13 +3636,20 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-2"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } void saveGDInspection() //检验批统计:管道 - { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-3"); + { List detailLists = new List(); JArray teamGroupData = GvGD.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3402,7 +3658,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-3", ContentName = values.Value("WorkName"), @@ -3423,14 +3680,21 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-3"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } void saveDQInspection() //检验批统计:电气 { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-4"); List detailLists = new List(); JArray teamGroupData = GvDq.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3439,7 +3703,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-4", ContentName = values.Value("WorkName"), @@ -3460,13 +3725,20 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-4"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } void saveYBInspection() //检验批统计:仪表 { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-5"); List detailLists = new List(); JArray teamGroupData = GvYb.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3475,7 +3747,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-5", ContentName = values.Value("WorkName"), @@ -3496,13 +3769,20 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-5"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } void saveFFInspection() //检验批统计:防腐 { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-6"); List detailLists = new List(); JArray teamGroupData = GvFf.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3511,7 +3791,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-6", ContentName = values.Value("WorkName"), @@ -3532,13 +3813,20 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-6"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } void saveXFInspection() //检验批统计:消防 { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-7"); List detailLists = new List(); JArray teamGroupData = GvXf.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3547,7 +3835,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10-7", ContentName = values.Value("WorkName"), @@ -3568,13 +3857,20 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10-7"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } void saveInspectionDataInspection() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10"); List detailLists = new List(); JArray teamGroupData = gvInspectionDataInspection.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3583,7 +3879,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "10", ContentName = values.Value("WorkName"), @@ -3606,17 +3903,23 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "10"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } - } #endregion #region 11.压力管道监检情况 void savePressureInspection() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "11"); List detailLists = new List(); JArray teamGroupData = gvPressureInspection.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3625,7 +3928,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "11", TotalNoBackCount = Funs.GetNewIntOrZero(values.Value("TotalNoBackCount")), @@ -3643,17 +3947,23 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "11"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } - } #endregion #region 12.管道试压包管理情况 void savePipingInspection() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "12"); List detailLists = new List(); JArray teamGroupData = gvPipingInspection.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3662,7 +3972,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "12", TotalNoBackCount = Funs.GetNewIntOrZero(values.Value("TotalNoBackCount")), @@ -3680,17 +3991,23 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "12"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } - } #endregion #region 13.特种设备监检情况 void saveSpecialInspection() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "13"); List detailLists = new List(); JArray teamGroupData = gvSpecialInspection.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3699,7 +4016,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "13", TotalNoBackCount = Funs.GetNewIntOrZero(values.Value("TotalNoBackCount")), @@ -3717,17 +4035,23 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "13"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } - } #endregion #region 14.NCR管理情况 void saveNcrManagementInspection() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "14"); List detailLists = new List(); JArray teamGroupData = gvNcrManagementInspection.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3736,7 +4060,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "14", ContentName = values.Value("WorkName"), @@ -3753,8 +4078,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "14"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3765,7 +4098,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveQualityInspection() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "1"); List detailLists = new List(); JArray teamGroupData = gvQualityInspection.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3774,7 +4106,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "1", ContentName = values.Value("ContentName"), @@ -3791,8 +4124,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "1"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3803,7 +4144,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveSpecialCheck() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "2"); List detailLists = new List(); JArray teamGroupData = gvSpecialCheck.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3812,7 +4152,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "2", ContentName = values.Value("ContentName"), @@ -3828,8 +4169,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "2"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3840,7 +4189,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveFileReport() { - BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "3"); List detailLists = new List(); JArray teamGroupData = gvFileReport.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3849,7 +4197,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem { - Id = values.Value("Id"), + //Id = values.Value("Id"), + Id = SQLHelper.GetNewID(), ReportId = ReportId, ReType = "3", ContentName = values.Value("ContentName"), @@ -3866,8 +4215,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId, "3"); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3878,7 +4235,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveRowMaterialProblem() { - BLL.RowMaterialProblemService.DeleteRowMaterialProbleByReportId(ReportId); List detailLists = new List(); JArray teamGroupData = gvRowMaterialProblem.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3887,7 +4243,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_RowMaterialProblem newDetail = new Model.Report_RowMaterialProblem { - RowMaterialProblemId = values.Value("RowMaterialProblemId"), + //RowMaterialProblemId = values.Value("RowMaterialProblemId"), + RowMaterialProblemId = SQLHelper.GetNewID(), ReportId = ReportId, UnitId = values.Value("UnitId"), ProblemDesrioption = values.Value("ProblemDesrioption"), @@ -3903,8 +4260,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_RowMaterialProblem.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.RowMaterialProblemService.DeleteRowMaterialProbleByReportId(ReportId); + db.Report_RowMaterialProblem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } @@ -3913,7 +4278,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveConstructionProblems() { - BLL.ConstructionProblemsService.DeleteConstructionProblemsByReportId(ReportId); List detailLists = new List(); JArray teamGroupData = gvConstructionProblems.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3922,7 +4286,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_ConstructionProblems newDetail = new Model.Report_ConstructionProblems { - ConstructionProblemsId = values.Value("ConstructionProblemsId"), + //ConstructionProblemsId = values.Value("ConstructionProblemsId"), + ConstructionProblemsId = SQLHelper.GetNewID(), ReportId = ReportId, UnitId = values.Value("UnitId"), ProblemDesrioption = values.Value("ProblemDesrioption"), @@ -3938,8 +4303,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_ConstructionProblems.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.ConstructionProblemsService.DeleteConstructionProblemsByReportId(ReportId); + db.Report_ConstructionProblems.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } @@ -3951,7 +4324,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void saveNextQualityControl() { - BLL.NextQualityControlService.DeleteNextQualityControlByReportId(ReportId); List detailLists = new List(); JArray teamGroupData = gvNextQualityControl.GetMergedData(); foreach (JObject teamGroupRow in teamGroupData) @@ -3960,7 +4332,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //int rowIndex = teamGroupRow.Value("index"); Model.Report_NextQualityControl newDetail = new Model.Report_NextQualityControl { - NextQualityControlId = values.Value("NextQualityControlId"), + //NextQualityControlId = values.Value("NextQualityControlId"), + NextQualityControlId= SQLHelper.GetNewID(), ReportId = ReportId, NextQualityControlContent = values.Value("NextQualityControlContent") }; @@ -3972,8 +4345,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - db.Report_NextQualityControl.InsertAllOnSubmit(detailLists); - db.SubmitChanges(); + try + { + BLL.NextQualityControlService.DeleteNextQualityControlByReportId(ReportId); + db.Report_NextQualityControl.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } } #endregion @@ -3983,7 +4364,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew { var ImageLists = new List(); var imgage1 = new Model.Report_TextBoxContent(); - imgage1.Id = Guid.NewGuid().ToString(); + imgage1.Id = SQLHelper.GetNewID(); imgage1.ReportId = ReportId; imgage1.ContentType = "23-1"; imgage1.ContentText = txtPhotoContent1.Text; @@ -3991,7 +4372,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage1); var imgage2 = new Model.Report_TextBoxContent(); - imgage2.Id = Guid.NewGuid().ToString(); + imgage2.Id = SQLHelper.GetNewID(); imgage2.ReportId = ReportId; imgage2.ContentType = "23-2"; imgage2.ContentText = txtPhotoContent2.Text; @@ -3999,7 +4380,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage2); var imgage3 = new Model.Report_TextBoxContent(); - imgage3.Id = Guid.NewGuid().ToString(); + imgage3.Id = SQLHelper.GetNewID(); imgage3.ReportId = ReportId; imgage3.ContentType = "23-3"; imgage3.ContentText = txtPhotoContent3.Text; @@ -4007,7 +4388,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage3); var imgage4 = new Model.Report_TextBoxContent(); - imgage4.Id = Guid.NewGuid().ToString(); + imgage4.Id = SQLHelper.GetNewID(); imgage4.ReportId = ReportId; imgage4.ContentType = "23-4"; imgage4.ContentText = txtPhotoContent4.Text; @@ -4015,7 +4396,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage4); var imgage5 = new Model.Report_TextBoxContent(); - imgage5.Id = Guid.NewGuid().ToString(); + imgage5.Id = SQLHelper.GetNewID(); imgage5.ReportId = ReportId; imgage5.ContentType = "23-5"; imgage5.ContentText = txtPhotoContent5.Text; @@ -4023,15 +4404,22 @@ namespace FineUIPro.Web.CQMS.ManageReportNew ImageLists.Add(imgage5); var imgage6 = new Model.Report_TextBoxContent(); - imgage6.Id = Guid.NewGuid().ToString(); + imgage6.Id = SQLHelper.GetNewID(); imgage6.ReportId = ReportId; imgage6.ContentType = "23-6"; imgage6.ContentText = txtPhotoContent6.Text; imgage6.ImageUrl = imgPhoto6.ImageUrl.Substring(imgPhoto6.ImageUrl.IndexOf("/") + 1); ImageLists.Add(imgage6); - db.Report_TextBoxContent.InsertAllOnSubmit(ImageLists); - db.SubmitChanges(); + try + { + db.Report_TextBoxContent.InsertAllOnSubmit(ImageLists); + db.SubmitChanges(); + } + catch (Exception) + { + return; + } } #endregion diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 1859e6a8..86deca86 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -19423,7 +19423,7 @@ - +