diff --git a/SGGL/BLL/OfficeCheck/Check/CheckNoticeService.cs b/SGGL/BLL/OfficeCheck/Check/CheckNoticeService.cs
index 4738fca9..dde84109 100644
--- a/SGGL/BLL/OfficeCheck/Check/CheckNoticeService.cs
+++ b/SGGL/BLL/OfficeCheck/Check/CheckNoticeService.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using NPOI.SS.Formula;
+using System.Collections.Generic;
using System.Linq;
namespace BLL
@@ -96,19 +97,34 @@ namespace BLL
///
public static void DeleteCheckNoticeByCheckNoticeId(string checkNoticeId)
{
- Model.ProjectSupervision_CheckNotice checkNotice = Funs.DB.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
- if (checkNotice != null)
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- var checkTeams = from x in Funs.DB.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x;
- if (checkTeams.Count() > 0)
+ var checkNotice = db.ProjectSupervision_CheckNotice.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
+ if (checkNotice != null)
{
- foreach (var item in checkTeams)
+ var checkTeams = from x in db.ProjectSupervision_CheckTeam where x.CheckNoticeId == checkNoticeId select x;
+ if (checkTeams.Count() > 0)
{
- BLL.CheckTeamService.DeleteCheckTeamByCheckTeamId(item.CheckTeamId);
+ db.ProjectSupervision_CheckTeam.DeleteAllOnSubmit(checkTeams);
}
+
+ var getCheck1 = from x in db.ProjectSupervision_Check1 where x.CheckNoticeId == checkNoticeId select x;
+ if (getCheck1.Count() > 0)
+ {
+ db.ProjectSupervision_Check1.DeleteAllOnSubmit(getCheck1);
+ }
+
+ var getCheckTable1 = from x in db.ProjectSupervision_CheckTable1 where x.CheckNoticeId == checkNoticeId select x;
+ if (getCheckTable1.Count() > 0)
+ {
+ db.ProjectSupervision_CheckTable1.DeleteAllOnSubmit(getCheckTable1);
+ }
+
+ CheckReportService.DeleteCheckReportByCheckNoticeId(checkNoticeId);
+ ProjectSupervision_RectifyService.DeleteRectifyByCheckNoticeId(checkNoticeId);
+ db.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice);
+ db.SubmitChanges();
}
- Funs.DB.ProjectSupervision_CheckNotice.DeleteOnSubmit(checkNotice);
- Funs.DB.SubmitChanges();
}
}
@@ -119,44 +135,47 @@ namespace BLL
///
public static List GetCheckInfoList(string unitId, string userId, string roleId)
{
- List checkInfoLists = new List();
- var role = BLL.RoleService.GetRoleByRoleId(roleId);
- if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null))
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList();
- }
- else
- {
- var checkInfoIdList = (from x in Funs.DB.ProjectSupervision_CheckTeam
- where x.UserId == userId && x.UnitId == unitId
- select x.CheckNoticeId).Distinct().ToList();
- if (checkInfoIdList.Count() > 0)
+ List checkInfoLists = new List();
+ var role = BLL.RoleService.GetRoleByRoleId(roleId);
+ if (userId == BLL.Const.sysglyId || (BLL.CommonService.IsMainUnitOrAdmin(unitId) && role != null))
{
- checkInfoLists = (from x in Funs.DB.ProjectSupervision_CheckNotice
- where checkInfoIdList.Contains(x.CheckNoticeId)
- orderby x.CheckStartTime
- select x).ToList();
+ checkInfoLists = (from x in db.ProjectSupervision_CheckNotice orderby x.CheckStartTime select x).ToList();
}
-
- var checkInfoIdList1 = (from x in Funs.DB.ProjectSupervision_CheckNotice
- where x.CompileMan == userId
- orderby x.CheckStartTime
- select x).ToList();
- if (checkInfoIdList1.Count() > 0)
+ else
{
- if (checkInfoLists.Count() > 0)
+ var checkInfoIdList = (from x in db.ProjectSupervision_CheckTeam
+ where x.UserId == userId && x.UnitId == unitId
+ select x.CheckNoticeId).Distinct().ToList();
+ if (checkInfoIdList.Count() > 0)
{
- checkInfoLists.AddRange(checkInfoIdList1);
+ checkInfoLists = (from x in db.ProjectSupervision_CheckNotice
+ where checkInfoIdList.Contains(x.CheckNoticeId)
+ orderby x.CheckStartTime
+ select x).ToList();
}
- else
- {
- checkInfoLists = checkInfoIdList1;
- }
- }
- checkInfoLists = checkInfoLists.Distinct().ToList();
+ var checkInfoIdList1 = (from x in db.ProjectSupervision_CheckNotice
+ where x.CompileMan == userId
+ orderby x.CheckStartTime
+ select x).ToList();
+ if (checkInfoIdList1.Count() > 0)
+ {
+ if (checkInfoLists.Count() > 0)
+ {
+ checkInfoLists.AddRange(checkInfoIdList1);
+ }
+ else
+ {
+ checkInfoLists = checkInfoIdList1;
+ }
+ }
+
+ checkInfoLists = checkInfoLists.Distinct().ToList();
+ }
+ return checkInfoLists;
}
- return checkInfoLists;
}
#region 根据检查ID得到检查内容项
diff --git a/SGGL/BLL/OfficeCheck/Check/CheckReportItemService.cs b/SGGL/BLL/OfficeCheck/Check/CheckReportItemService.cs
index 30e25805..2375b227 100644
--- a/SGGL/BLL/OfficeCheck/Check/CheckReportItemService.cs
+++ b/SGGL/BLL/OfficeCheck/Check/CheckReportItemService.cs
@@ -28,11 +28,14 @@ namespace BLL
///
public static void DeleteCheckReportItemByCheckReportId(string checkReportId)
{
- var q = (from x in Funs.DB.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList();
- if (q != null)
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- Funs.DB.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q);
- Funs.DB.SubmitChanges();
+ var q = (from x in db.ProjectSupervision_CheckReportItem where x.CheckReportId == checkReportId select x).ToList();
+ if (q != null)
+ {
+ db.ProjectSupervision_CheckReportItem.DeleteAllOnSubmit(q);
+ db.SubmitChanges();
+ }
}
}
}
diff --git a/SGGL/BLL/OfficeCheck/Check/CheckReportService.cs b/SGGL/BLL/OfficeCheck/Check/CheckReportService.cs
index 906ee3ce..338d9ed1 100644
--- a/SGGL/BLL/OfficeCheck/Check/CheckReportService.cs
+++ b/SGGL/BLL/OfficeCheck/Check/CheckReportService.cs
@@ -61,11 +61,15 @@ namespace BLL
///
public static void DeleteCheckReportByCheckNoticeId(string checkNoticeId)
{
- Model.ProjectSupervision_CheckReport checkReport = Funs.DB.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
- if (checkReport != null)
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- Funs.DB.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport);
- Funs.DB.SubmitChanges();
+ Model.ProjectSupervision_CheckReport checkReport = db.ProjectSupervision_CheckReport.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
+ if (checkReport != null)
+ {
+ CheckReportItemService.DeleteCheckReportItemByCheckReportId(checkReport.CheckReportId);
+ db.ProjectSupervision_CheckReport.DeleteOnSubmit(checkReport);
+ db.SubmitChanges();
+ }
}
}
}
diff --git a/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyItemService.cs b/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyItemService.cs
index 221dafa2..4436d891 100644
--- a/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyItemService.cs
+++ b/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyItemService.cs
@@ -36,11 +36,14 @@ namespace BLL
public static void DeleteRectifyItemByRectifyId(string rectifyId)
{
- var q = (from x in Funs.DB.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList();
- if (q != null)
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- Funs.DB.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q);
- Funs.DB.SubmitChanges();
+ var q = (from x in db.ProjectSupervision_RectifyItem where x.RectifyId == rectifyId select x).ToList();
+ if (q != null)
+ {
+ db.ProjectSupervision_RectifyItem.DeleteAllOnSubmit(q);
+ db.SubmitChanges();
+ }
}
}
diff --git a/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyService.cs b/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyService.cs
index 338c802f..3c539049 100644
--- a/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyService.cs
+++ b/SGGL/BLL/OfficeCheck/Check/ProjectSupervision_RectifyService.cs
@@ -75,13 +75,16 @@ namespace BLL
///
public static void DeleteRectifyByCheckNoticeId(string checkNoticeId)
{
- Model.ProjectSupervision_Rectify newRectify = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
- if (newRectify != null)
+ using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
- Funs.DB.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify);
- Funs.DB.SubmitChanges();
+ var newRectify = db.ProjectSupervision_Rectify.FirstOrDefault(e => e.CheckNoticeId == checkNoticeId);
+ if (newRectify != null)
+ {
+ ProjectSupervision_RectifyItemService.DeleteRectifyItemByRectifyId(newRectify.RectifyId);
+ db.ProjectSupervision_Rectify.DeleteOnSubmit(newRectify);
+ db.SubmitChanges();
+ }
}
-
}
}
}
diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
index a85d8861..8299ad1e 100644
--- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
+++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj
@@ -14435,7 +14435,7 @@
True
0
/
- http://localhost:2828/
+ http://localhost:14574/
False
False
diff --git a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx
index 6c71a848..a7faddac 100644
--- a/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/Check/OfficeCheck.aspx
@@ -17,15 +17,16 @@
-
-
-
+
+
+
@@ -34,6 +35,12 @@
+
+
+
+
@@ -52,6 +59,10 @@
+
+
+
+
@@ -59,6 +70,26 @@
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
+
+