优化月报加载

This commit is contained in:
潘鸿锋 2024-04-28 09:05:00 +08:00
parent fbc54e00b2
commit 34b758f841
1 changed files with 211 additions and 176 deletions

View File

@ -41,6 +41,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
}
#endregion
public Model.SGGLDB db = Funs.DB;
#region
private static List<Model.Report_CqmsTarget> detailsGrid1 = new List<Model.Report_CqmsTarget>();
@ -62,6 +64,26 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
private static List<Model.Report_NextQualityControl> nextQualityControlLists = new List<Model.Report_NextQualityControl>();
#endregion
#region
public class UnitClass {
public string UnitId { get; set; }
public string UnitName { get; set; }
public string UnitType { get; set; }
}
public List<UnitClass> units = new List<UnitClass>();
#endregion
#region
public class ProfessionalsClass {
public string CNProfessionalId { get; set; }
public string ProfessionalName { get; set; }
}
public List<ProfessionalsClass> CNProfessionals = new List<ProfessionalsClass>();
#endregion
#region
/// <summary>
/// 加载页面
@ -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
/// </summary>
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<Model.Report_Construction_Plan>();
@ -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
/// </summary>
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<Model.Report_Construction_Plan>();
@ -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
/// </summary>
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<Model.Report_Construction_Plan>();
@ -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
/// </summary>
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<Model.Report_Construction_Plan>();
@ -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
/// </summary>
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<Model.Report_Construction_Plan>();
@ -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<Model.ProcessControl_NondestructiveTest_New>();
//加载所有施工分包单位
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
/// </summary>
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<Model.Report_Construction_Plan>();
@ -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
/// </summary>
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<Model.Report_CQMS_MonthReportItem>();
@ -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<Model.CheckStatisc>();
@ -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<string> workNames = new List<string>();
//专业下所有集合
@ -1840,7 +1875,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
/// </summary>
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<Model.Report_CQMS_MonthReportItem>();
@ -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
/// </summary>
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<Model.Report_CQMS_MonthReportItem>();
@ -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
/// </summary>
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<Model.Report_CQMS_MonthReportItem>();
@ -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
/// </summary>
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<Model.Report_CQMS_MonthReportItem>();
@ -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
/// </summary>
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<Model.Report_CQMS_MonthReportItem>();
@ -2330,7 +2365,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
/// </summary>
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<Model.Report_CQMS_MonthReportItem>();
@ -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