This commit is contained in:
夏菊 2025-10-22 18:31:54 +08:00
parent 46f56a27cb
commit 6a906beb70
1 changed files with 33 additions and 17 deletions

View File

@ -407,11 +407,15 @@ namespace BLL
List<Model.ProcessControl_InspectionManagement> InspectionMangementList = (from x in Funs.DB.ProcessControl_InspectionManagement where x.ProjectId == projectId select x).ToList(); List<Model.ProcessControl_InspectionManagement> InspectionMangementList = (from x in Funs.DB.ProcessControl_InspectionManagement where x.ProjectId == projectId select x).ToList();
if (isOnceQualified == true) if (isOnceQualified == true)
{ {
InspectionMangementList = (from x in InspectionMangementList where x.IsOnceQualified == null || x.IsOnceQualified == true select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.IsOnceQualified == null || x.IsOnceQualified == true).ToList();
} }
if (startDate != null && SoptDate != null) if (startDate != null)
{ {
InspectionMangementList = (from x in InspectionMangementList where x.InspectionDate >= startDate && x.InspectionDate <= SoptDate select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.InspectionDate >= startDate).ToList();
}
if (SoptDate != null)
{
InspectionMangementList = InspectionMangementList.Where(x => x.InspectionDate <= SoptDate || x.InspectionDate == null).ToList();
} }
return InspectionMangementList; return InspectionMangementList;
} }
@ -422,19 +426,23 @@ namespace BLL
if (!string.IsNullOrEmpty(projectId)) if (!string.IsNullOrEmpty(projectId))
{ {
InspectionMangementList = (from x in InspectionMangementList where x.ProjectId == projectId select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.ProjectId == projectId).ToList();
} }
if (!string.IsNullOrEmpty(cNProfessionalId) && cNProfessionalId != "0") if (!string.IsNullOrEmpty(cNProfessionalId) && cNProfessionalId != "0")
{ {
InspectionMangementList = (from x in InspectionMangementList where x.CNProfessionalId == cNProfessionalId select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.CNProfessionalId == cNProfessionalId).ToList();
} }
if (isOnceQualified == true) if (isOnceQualified == true)
{ {
InspectionMangementList = (from x in InspectionMangementList where x.IsOnceQualified == null || x.IsOnceQualified == true select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.IsOnceQualified == null || x.IsOnceQualified == true).ToList();
} }
if (startDate != null && SoptDate != null) if (startDate != null)
{ {
InspectionMangementList = (from x in InspectionMangementList where x.InspectionDate >= startDate && x.InspectionDate <= SoptDate select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.InspectionDate >= startDate).ToList();
}
if (SoptDate != null)
{
InspectionMangementList = InspectionMangementList.Where(x => x.InspectionDate <= SoptDate || x.InspectionDate == null).ToList();
} }
return InspectionMangementList; return InspectionMangementList;
@ -445,15 +453,19 @@ namespace BLL
List<Model.ProcessControl_InspectionManagement> InspectionMangementList = (from x in Funs.DB.ProcessControl_InspectionManagement where x.ProjectId == projectId select x).ToList(); List<Model.ProcessControl_InspectionManagement> InspectionMangementList = (from x in Funs.DB.ProcessControl_InspectionManagement where x.ProjectId == projectId select x).ToList();
if (!string.IsNullOrEmpty(unitId) && unitId != "0") if (!string.IsNullOrEmpty(unitId) && unitId != "0")
{ {
InspectionMangementList = (from x in InspectionMangementList where x.UnitId == unitId select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.UnitId == unitId).ToList();
} }
if (isOnceQualified == true) if (isOnceQualified == true)
{ {
InspectionMangementList = (from x in InspectionMangementList where x.IsOnceQualified == null || x.IsOnceQualified == true select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.IsOnceQualified == null || x.IsOnceQualified == true).ToList();
} }
if (startDate != null && SoptDate != null) if (startDate != null)
{ {
InspectionMangementList = (from x in InspectionMangementList where x.InspectionDate >= startDate && x.InspectionDate <= SoptDate select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.InspectionDate >= startDate).ToList();
}
if (SoptDate != null)
{
InspectionMangementList = InspectionMangementList.Where(x => x.InspectionDate <= SoptDate || x.InspectionDate == null).ToList();
} }
return InspectionMangementList; return InspectionMangementList;
@ -466,19 +478,23 @@ namespace BLL
if (!string.IsNullOrEmpty(projectId)) if (!string.IsNullOrEmpty(projectId))
{ {
InspectionMangementList = (from x in InspectionMangementList where x.ProjectId == projectId select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.ProjectId == projectId).ToList();
} }
if (!string.IsNullOrEmpty(cNProfessionalId) && cNProfessionalId != "0") if (!string.IsNullOrEmpty(cNProfessionalId) && cNProfessionalId != "0")
{ {
InspectionMangementList = (from x in InspectionMangementList where x.CNProfessionalId == cNProfessionalId select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.CNProfessionalId == cNProfessionalId).ToList();
} }
if (isOnceQualified == true) if (isOnceQualified == true)
{ {
InspectionMangementList = (from x in InspectionMangementList where x.IsOnceQualified == null || x.IsOnceQualified == true select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.IsOnceQualified == null || x.IsOnceQualified == true).ToList();
} }
if (startDate != null && SoptDate != null) if (startDate != null)
{ {
InspectionMangementList = (from x in InspectionMangementList where x.InspectionDate >= startDate && x.InspectionDate <= SoptDate select x).ToList(); InspectionMangementList = InspectionMangementList.Where(x => x.InspectionDate >= startDate).ToList();
}
if (SoptDate != null)
{
InspectionMangementList = InspectionMangementList.Where(x => x.InspectionDate <= SoptDate || x.InspectionDate == null).ToList();
} }
return InspectionMangementList; return InspectionMangementList;