diff --git a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportNewEdit.aspx.cs index 80b6c00c..2e104f12 100644 --- a/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportNewEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/ManageReportNew/MonthReportNewEdit.aspx.cs @@ -83,6 +83,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew if (!string.IsNullOrEmpty(this.ReportId)) { + var db = Funs.DB; Model.Report_WeekAndMonthReport_New weekAndMonthReport = WeekAndMonthReportNewService.Detail(this.ReportId); if (weekAndMonthReport != null) { @@ -103,7 +104,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 +120,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) @@ -130,7 +131,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) @@ -143,7 +144,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) @@ -482,8 +483,8 @@ 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 + 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 }; @@ -563,8 +564,8 @@ 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 + 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 }; @@ -621,6 +622,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew public void CheckLotBindStatisc(string cNProfessionalCode) { + var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); @@ -646,7 +648,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(); //专业下所有集合 @@ -869,8 +871,8 @@ 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 + 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 }; @@ -947,8 +949,8 @@ 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 + 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 }; @@ -1025,8 +1027,8 @@ 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 + 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 }; @@ -1092,6 +1094,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew /// void loadNcrManagementInspection(string objType) { + var db = Funs.DB; DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim()); DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim()); List StatisticsList = new List(); @@ -1108,12 +1111,11 @@ 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 + 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 }; - var db = Funs.DB; foreach (var item in units) { @@ -1204,8 +1206,8 @@ 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 + 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 }; @@ -1344,8 +1346,8 @@ 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 + 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 }; diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 91712252..d5c45da5 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -20498,7 +20498,7 @@ - +