From 34b758f8410d006673b807ff1df6003d3af3a166 Mon Sep 17 00:00:00 2001 From: panhf <754998852@qq.com> Date: Sun, 28 Apr 2024 09:05:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9C=88=E6=8A=A5=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManageReportNew/MonthReportEdit.aspx.cs | 387 ++++++++++-------- 1 file changed, 211 insertions(+), 176 deletions(-) diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs index 64b29ff4..4ae5d19a 100644 --- a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportEdit.aspx.cs @@ -41,6 +41,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } #endregion + public Model.SGGLDB db = Funs.DB; + #region 列表集合 private static List detailsGrid1 = new List(); @@ -62,6 +64,26 @@ namespace FineUIPro.Web.CQMS.ManageReportNew private static List nextQualityControlLists = new List(); #endregion + #region 加载所有单位 + public class UnitClass { + public string UnitId { get; set; } + public string UnitName { get; set; } + + public string UnitType { get; set; } + } + + public List units = new List(); + #endregion + + #region 加载所有专业 + public class ProfessionalsClass { + public string CNProfessionalId { get; set; } + public string ProfessionalName { get; set; } + } + + public List CNProfessionals = new List(); + #endregion + #region 加载页面 /// /// 加载页面 @@ -72,6 +94,23 @@ namespace FineUIPro.Web.CQMS.ManageReportNew { if (!IsPostBack) { + //加载所有单位 + units = (from x in db.Project_ProjectUnit + join y in db.Base_Unit on x.UnitId equals y.UnitId + where x.ProjectId == this.CurrUser.LoginProjectId + orderby y.UnitCode + select new UnitClass{ UnitId=x.UnitId, UnitName=y.UnitName, UnitType=x.UnitType }).ToList(); + //加载所有专业 + CNProfessionals = (from x in db.Base_CNProfessional + where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId + && x.CNProfessionalId != BLL.Const.ComprehensiveId + orderby x.SortIndex + select new ProfessionalsClass + { + CNProfessionalId=x.CNProfessionalId, + ProfessionalName=x.ProfessionalName + }).ToList(); + BLL.UnitService.InitUnitNameByProjectIdUnitTypeDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, false); BLL.UnitService.InitUnitDownListByText(this.drpUnitIdGrid9, this.CurrUser.LoginProjectId, true); this.EnableViewState = true; @@ -105,7 +144,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #region 加载本月质量目标管理情况 detailsGrid1.Clear(); - detailsGrid1 = (from x in Funs.DB.Report_CqmsTarget + detailsGrid1 = (from x in db.Report_CqmsTarget where x.ReportId == this.ReportId orderby x.SortId select x).ToList(); @@ -119,7 +158,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #endregion #region 加载7.2 PQR/WPS报验情况 - var detailsGrid9 = (from x in Funs.DB.Report_Construction_Plan + var detailsGrid9 = (from x in db.Report_Construction_Plan where x.ReportId == ReportId && x.ReType == "5" select x).ToList(); if (detailsGrid9.Count > 0) @@ -143,7 +182,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #region 加载18.本月质量问题处理情况 //(1)原材料问题 rowMaterialProblemLists.Clear(); - rowMaterialProblemLists = (from x in Funs.DB.Report_RowMaterialProblem + rowMaterialProblemLists = (from x in db.Report_RowMaterialProblem where x.ReportId == this.ReportId select x).ToList(); if (rowMaterialProblemLists.Count > 0) @@ -154,7 +193,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } //(2)施工过程问题 constructionProblemsLists.Clear(); - constructionProblemsLists = (from x in Funs.DB.Report_ConstructionProblems + constructionProblemsLists = (from x in db.Report_ConstructionProblems where x.ReportId == this.ReportId select x).ToList(); if (constructionProblemsLists.Count > 0) @@ -167,7 +206,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #region 加载19.下月质量控制重点 nextQualityControlLists.Clear(); - nextQualityControlLists = (from x in Funs.DB.Report_NextQualityControl + nextQualityControlLists = (from x in db.Report_NextQualityControl where x.ReportId == this.ReportId select x).ToList(); if (nextQualityControlLists.Count > 0) @@ -179,7 +218,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #endregion #region 加载文本框内容 - var txtReportList = Funs.DB.Report_TextBoxContent.Where(x => x.ReportId == ReportId).ToList(); + var txtReportList = db.Report_TextBoxContent.Where(x => x.ReportId == ReportId).ToList(); 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; @@ -384,7 +423,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadGeneralPlanApproval(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -393,11 +431,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity1Sum = 0; int Quantity2Sum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { @@ -465,7 +504,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadMajorPlanApproval(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -475,11 +513,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity2Sum = 0; int Quantity3Sum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { @@ -551,7 +590,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadInspectionTestPlan(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -560,15 +598,15 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity1Sum = 0; int Quantity2Sum = 0; //加载所有专业 - var CNProfessionals = from x in Funs.DB.Base_CNProfessional - where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId - && x.CNProfessionalId != BLL.Const.ComprehensiveId - orderby x.SortIndex - select new - { - x.CNProfessionalId, - x.ProfessionalName - }; + //var CNProfessionals = from x in db.Base_CNProfessional + // where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId + // && x.CNProfessionalId != BLL.Const.ComprehensiveId + // orderby x.SortIndex + // select new + // { + // x.CNProfessionalId, + // x.ProfessionalName + // }; foreach (var item in CNProfessionals) @@ -639,7 +677,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadDesignDetailsApprove(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -648,15 +685,15 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity1Sum = 0; int Quantity2Sum = 0; //加载所有专业 - var CNProfessionals = from x in Funs.DB.Base_CNProfessional - where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId - && x.CNProfessionalId != BLL.Const.ComprehensiveId - orderby x.SortIndex - select new - { - x.CNProfessionalId, - x.ProfessionalName - }; + //var CNProfessionals = from x in db.Base_CNProfessional + // where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId + // && x.CNProfessionalId != BLL.Const.ComprehensiveId + // orderby x.SortIndex + // select new + // { + // x.CNProfessionalId, + // x.ProfessionalName + // }; foreach (var item in CNProfessionals) @@ -723,7 +760,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadReviewDrawings(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -732,15 +768,15 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity1Sum = 0; int Quantity2Sum = 0; //加载所有专业 - var CNProfessionals = from x in Funs.DB.Base_CNProfessional - where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId - && x.CNProfessionalId != BLL.Const.ComprehensiveId - orderby x.SortIndex - select new - { - x.CNProfessionalId, - x.ProfessionalName - }; + //var CNProfessionals = from x in db.Base_CNProfessional + // where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId + // && x.CNProfessionalId != BLL.Const.ComprehensiveId + // orderby x.SortIndex + // select new + // { + // x.CNProfessionalId, + // x.ProfessionalName + // }; foreach (var item in CNProfessionals) @@ -822,7 +858,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } } int i = 1; - var cNProfessionals = from x in Funs.DB.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId + var cNProfessionals = from x in db.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && x.CNProfessionalId != BLL.Const.ComprehensiveId orderby x.SortIndex select x; foreach (var item in cNProfessionals) { @@ -887,12 +923,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } } int i = 1; - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2 - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; - var db = Funs.DB; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2 + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2).ToList(); foreach (var item in units) { @@ -1103,17 +1139,16 @@ namespace FineUIPro.Web.CQMS.ManageReportNew #region 7.3 无损检测管理 Grid10方法 void loadProcessControl_NondestructiveTest_New() { - var db = Funs.DB; - DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); //加载所有施工分包单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2).ToList(); int? totalNum0 = 0, totalNum1 = 0;//拍片数量合计 @@ -1291,7 +1326,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void LoadInspectionEquipment(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -1300,11 +1334,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity1Sum = 0; int Quantity2Sum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { @@ -1400,7 +1435,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadMeasuringInspection(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -1409,11 +1443,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity1Sum = 0; int Quantity2Sum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { var query = from c in db.Comprehensive_InspectionMachine @@ -1481,7 +1516,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew CheckLotBindStatisc("XF");//检验批统计:消防 #region 现场质量共检数据合计 - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -1498,11 +1532,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { var query = from c in db.View_CQMS_InspectionManagementDetail @@ -1625,7 +1660,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } } //int i = 1; - string cNProfessionalId = (from x in Funs.DB.Base_CNProfessional where x.CNProfessionalCode == cNProfessionalCode select x.CNProfessionalId).FirstOrDefault(); + string cNProfessionalId = (from x in db.Base_CNProfessional where x.CNProfessionalCode == cNProfessionalCode select x.CNProfessionalId).FirstOrDefault(); List workNames = new List(); //专业下所有集合 @@ -1840,7 +1875,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadPressureInspection(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -1850,11 +1884,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity1Sum = 0; int Quantity2Sum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { var query = from c in db.Comprehensive_PressurePipe @@ -1916,7 +1951,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadPipingInspection(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -1927,11 +1961,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity2Sum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { var query = from c in db.Comprehensive_PressurePipe @@ -1994,7 +2029,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadSpecialInspection(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -2004,11 +2038,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity1Sum = 0; int Quantity2Sum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { var query = from c in db.Comprehensive_SpecialEquipment @@ -2086,12 +2121,13 @@ namespace FineUIPro.Web.CQMS.ManageReportNew { projectStartDate = project.StartDate.Value; } - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2 - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; - var db = Funs.DB; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitType == BLL.Const.ProjectUnitType_2 + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2).ToList(); + foreach (var item in units) { @@ -2171,7 +2207,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadQualityInspection(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -2181,11 +2216,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity2Sum = 0; int ClosedCountSum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { var query = from c in db.Check_CheckControl @@ -2264,7 +2300,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadSpecialCheck(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -2330,7 +2365,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadFileReport(string objType) { - var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); var list = new List(); @@ -2341,11 +2375,12 @@ namespace FineUIPro.Web.CQMS.ManageReportNew int Quantity3Sum = 0; int Quantity4Sum = 0; //加载所有单位 - var units = from x in Funs.DB.Project_ProjectUnit - join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId - where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) - orderby y.UnitCode - select new { x.UnitId, y.UnitName }; + //var units = from x in db.Project_ProjectUnit + // join y in db.Base_Unit on x.UnitId equals y.UnitId + // where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1) + // orderby y.UnitCode + // select new { x.UnitId, y.UnitName }; + units = units.Where(x => x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1).ToList(); foreach (var item in units) { var query = from c in db.Comprehensive_DataReceivingDoc @@ -2866,8 +2901,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CqmsTarget.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CqmsTarget.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -2900,8 +2935,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -2936,8 +2971,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -2971,8 +3006,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -3005,8 +3040,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3041,8 +3076,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3077,8 +3112,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3114,8 +3149,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_Construction_Plan.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_Construction_Plan.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3178,8 +3213,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew model8.ContentText = txtAre8.Text; txtContentList.Add(model8); #endregion - Funs.DB.Report_TextBoxContent.InsertAllOnSubmit(txtContentList); - Funs.DB.SubmitChanges(); + db.Report_TextBoxContent.InsertAllOnSubmit(txtContentList); + db.SubmitChanges(); } #endregion @@ -3211,8 +3246,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3249,8 +3284,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } void saveSbInspection() //检验批统计:设备 @@ -3283,8 +3318,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } void saveGDInspection() //检验批统计:管道 @@ -3317,8 +3352,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -3352,8 +3387,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } void saveYBInspection() //检验批统计:仪表 @@ -3386,8 +3421,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } void saveFFInspection() //检验批统计:防腐 @@ -3420,8 +3455,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } void saveXFInspection() //检验批统计:消防 @@ -3454,8 +3489,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } void saveInspectionDataInspection() @@ -3490,8 +3525,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -3525,8 +3560,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -3560,8 +3595,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -3595,8 +3630,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -3629,8 +3664,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3665,8 +3700,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3700,8 +3735,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3736,8 +3771,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3771,8 +3806,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_RowMaterialProblem.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_RowMaterialProblem.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -3804,8 +3839,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_ConstructionProblems.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_ConstructionProblems.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } @@ -3836,8 +3871,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew } if (detailLists.Count > 0) { - Funs.DB.Report_NextQualityControl.InsertAllOnSubmit(detailLists); - Funs.DB.SubmitChanges(); + db.Report_NextQualityControl.InsertAllOnSubmit(detailLists); + db.SubmitChanges(); } } #endregion @@ -3894,8 +3929,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew imgage6.ImageUrl = imgPhoto6.ImageUrl.Substring(imgPhoto6.ImageUrl.IndexOf("/") + 1); ImageLists.Add(imgage6); - Funs.DB.Report_TextBoxContent.InsertAllOnSubmit(ImageLists); - Funs.DB.SubmitChanges(); + db.Report_TextBoxContent.InsertAllOnSubmit(ImageLists); + db.SubmitChanges(); } #endregion