20210430
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ConstructionStandardIdentifyService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据标准规范辨识主键获取一个标准规范辨识信息
|
||||
/// </summary>
|
||||
/// <param name="constructionStandardIdentifyId">标准规范辨识主键</param>
|
||||
/// <returns>一个标准规范辨识实体</returns>
|
||||
public static Model.InformationProject_ConstructionStandardIdentify GetConstructionStandardIdentifyById(string constructionStandardIdentifyId)
|
||||
{
|
||||
return Funs.DB.InformationProject_ConstructionStandardIdentify.FirstOrDefault(x => x.ConstructionStandardIdentifyId == constructionStandardIdentifyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询还未生成版本号的标准规范量
|
||||
/// </summary>
|
||||
/// <returns>还未生成版本号的标准规范的数量</returns>
|
||||
public static int GetConstructionStandardIdentifyByVersionIsNull(string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.InformationProject_ConstructionStandardIdentify where x.ProjectId == projectId && x.VersionNumber == null select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加标准规范辨识信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationIdentify">标准规范辨识实体</param>
|
||||
public static void AddConstructionStandardIdentify(Model.InformationProject_ConstructionStandardIdentify constructionStandardIdentify)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ConstructionStandardIdentify newConstructionStandardIdentify = new Model.InformationProject_ConstructionStandardIdentify
|
||||
{
|
||||
ConstructionStandardIdentifyId = constructionStandardIdentify.ConstructionStandardIdentifyId,
|
||||
ConstructionStandardIdentifyCode = constructionStandardIdentify.ConstructionStandardIdentifyCode,
|
||||
VersionNumber = constructionStandardIdentify.VersionNumber,
|
||||
ProjectId = constructionStandardIdentify.ProjectId,
|
||||
IdentifyPerson = constructionStandardIdentify.IdentifyPerson,
|
||||
IdentifyDate = constructionStandardIdentify.IdentifyDate,
|
||||
State = constructionStandardIdentify.State,
|
||||
Remark = constructionStandardIdentify.Remark,
|
||||
UpdateDate = constructionStandardIdentify.UpdateDate
|
||||
};
|
||||
db.InformationProject_ConstructionStandardIdentify.InsertOnSubmit(newConstructionStandardIdentify);
|
||||
db.SubmitChanges();
|
||||
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ConstructionStandardIdentifyMenuId, constructionStandardIdentify.ProjectId, null, constructionStandardIdentify.ConstructionStandardIdentifyId, constructionStandardIdentify.IdentifyDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改标准规范辨识信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationIdentify">标准规范辨识实体</param>
|
||||
public static void UpdateConstructionStandardIdentify(Model.InformationProject_ConstructionStandardIdentify constructionStandardIdentify)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ConstructionStandardIdentify newConstructionStandardIdentify = db.InformationProject_ConstructionStandardIdentify.FirstOrDefault(e => e.ConstructionStandardIdentifyId == constructionStandardIdentify.ConstructionStandardIdentifyId);
|
||||
if (newConstructionStandardIdentify != null)
|
||||
{
|
||||
newConstructionStandardIdentify.ConstructionStandardIdentifyCode = constructionStandardIdentify.ConstructionStandardIdentifyCode;
|
||||
newConstructionStandardIdentify.VersionNumber = constructionStandardIdentify.VersionNumber;
|
||||
newConstructionStandardIdentify.ProjectId = constructionStandardIdentify.ProjectId;
|
||||
newConstructionStandardIdentify.IdentifyPerson = constructionStandardIdentify.IdentifyPerson;
|
||||
newConstructionStandardIdentify.IdentifyDate = constructionStandardIdentify.IdentifyDate;
|
||||
newConstructionStandardIdentify.State = constructionStandardIdentify.State;
|
||||
newConstructionStandardIdentify.Remark = constructionStandardIdentify.Remark;
|
||||
newConstructionStandardIdentify.UpdateDate = constructionStandardIdentify.UpdateDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据标准规范辨识编号删除一个标准规范辨识信息
|
||||
/// </summary>
|
||||
/// <param name="constructionStandardIdentifyId">标准规范辨识主键</param>
|
||||
public static void DeleteConstructionStandardIdentifyById(string constructionStandardIdentifyId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_ConstructionStandardIdentify constructionStandardIdentify = db.InformationProject_ConstructionStandardIdentify.FirstOrDefault(e => e.ConstructionStandardIdentifyId == constructionStandardIdentifyId);
|
||||
if (constructionStandardIdentify != null)
|
||||
{
|
||||
CodeRecordsService.DeleteCodeRecordsByDataId(constructionStandardIdentifyId);//删除编号
|
||||
//CommonService.DeleteAttachFileById(constructionStandardIdentifyId);//删除附件
|
||||
CommonService.DeleteFlowOperateByID(constructionStandardIdentifyId);//删除流程
|
||||
db.InformationProject_ConstructionStandardIdentify.DeleteOnSubmit(constructionStandardIdentify);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ConstructionStandardSelectedItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据标准规范辨识Id获取对应所有标准规范项信息
|
||||
/// </summary>
|
||||
/// <param name="constructionStandardIdentifyId">标准规范辨识Id</param>
|
||||
/// <returns>所有标准规范项信息</returns>
|
||||
public static List<Model.InformationProject_ConstructionStandardSelectedItem> GetConstructionStandardSelectedItemsByConstructionStandardIdentifyId(string constructionStandardIdentifyId)
|
||||
{
|
||||
return (from x in Funs.DB.InformationProject_ConstructionStandardSelectedItem where x.ConstructionStandardIdentifyId == constructionStandardIdentifyId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加标准规范项信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationSelectedItem">标准规范项实体</param>
|
||||
public static void AddConstructionStandardSelectedItem(Model.InformationProject_ConstructionStandardSelectedItem constructionStandardSelectedItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.InformationProject_ConstructionStandardSelectedItem));
|
||||
Model.InformationProject_ConstructionStandardSelectedItem newLawRegulationSelectedItem = new Model.InformationProject_ConstructionStandardSelectedItem
|
||||
{
|
||||
ConstructionStandardSelectedItemId = newKeyID,
|
||||
ConstructionStandardIdentifyId = constructionStandardSelectedItem.ConstructionStandardIdentifyId,
|
||||
StandardId = constructionStandardSelectedItem.StandardId
|
||||
};
|
||||
db.InformationProject_ConstructionStandardSelectedItem.InsertOnSubmit(newLawRegulationSelectedItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据标准规范辨识主键删除对应的所有标准规范项信息
|
||||
/// </summary>
|
||||
/// <param name="constructionStandardIdentifyId">标准规范辨识主键</param>
|
||||
public static void DeleteConstructionStandardSelectedItemByConstructionStandardIdentifyId(string constructionStandardIdentifyId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.InformationProject_ConstructionStandardSelectedItem where x.ConstructionStandardIdentifyId == constructionStandardIdentifyId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
db.InformationProject_ConstructionStandardSelectedItem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class FileCabinetAItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键id获取项目明细
|
||||
/// </summary>
|
||||
/// <param name="appraise"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_FileCabinetAItem GetFileCabinetAItemByID(string FileCabinetAItemId)
|
||||
{
|
||||
return Funs.DB.InformationProject_FileCabinetAItem.FirstOrDefault(x => x.FileCabinetAItemId == FileCabinetAItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加项目文件
|
||||
/// </summary>
|
||||
/// <param name="FileCabinetAItem"></param>
|
||||
public static void AddFileCabinetAItem(Model.InformationProject_FileCabinetAItem FileCabinetAItem)
|
||||
{
|
||||
Model.InformationProject_FileCabinetAItem newFileCabinetAItem = new Model.InformationProject_FileCabinetAItem
|
||||
{
|
||||
FileCabinetAItemId = FileCabinetAItem.FileCabinetAItemId,
|
||||
FileCabinetAId = FileCabinetAItem.FileCabinetAId,
|
||||
Code = FileCabinetAItem.Code,
|
||||
Title = FileCabinetAItem.Title,
|
||||
FileContent = FileCabinetAItem.FileContent,
|
||||
CompileMan = FileCabinetAItem.CompileMan,
|
||||
CompileDate = FileCabinetAItem.CompileDate,
|
||||
Remark = FileCabinetAItem.Remark,
|
||||
AttachUrl = FileCabinetAItem.AttachUrl,
|
||||
IsMenu = FileCabinetAItem.IsMenu,
|
||||
Url = FileCabinetAItem.Url
|
||||
};
|
||||
Funs.DB.InformationProject_FileCabinetAItem.InsertOnSubmit(newFileCabinetAItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改项目文件
|
||||
/// </summary>
|
||||
/// <param name="FileCabinetAItem"></param>
|
||||
public static void UpdateFileCabinetAItem(Model.InformationProject_FileCabinetAItem FileCabinetAItem)
|
||||
{
|
||||
Model.InformationProject_FileCabinetAItem newFileCabinetAItem = Funs.DB.InformationProject_FileCabinetAItem.FirstOrDefault(e => e.FileCabinetAId == FileCabinetAItem.FileCabinetAId);
|
||||
if (newFileCabinetAItem != null)
|
||||
{
|
||||
newFileCabinetAItem.Code = FileCabinetAItem.Code;
|
||||
newFileCabinetAItem.Title = FileCabinetAItem.Title;
|
||||
newFileCabinetAItem.FileContent = FileCabinetAItem.FileContent;
|
||||
newFileCabinetAItem.CompileMan = FileCabinetAItem.CompileMan;
|
||||
newFileCabinetAItem.CompileDate = FileCabinetAItem.CompileDate;
|
||||
newFileCabinetAItem.Remark = FileCabinetAItem.Remark;
|
||||
newFileCabinetAItem.AttachUrl = FileCabinetAItem.AttachUrl;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除信息
|
||||
/// </summary>
|
||||
/// <param name="FileCabinetAItemId"></param>
|
||||
public static void DeleteFileCabinetAItemByID(string FileCabinetAItemId)
|
||||
{
|
||||
Model.InformationProject_FileCabinetAItem fileCabinetAItem = Funs.DB.InformationProject_FileCabinetAItem.FirstOrDefault(e => e.FileCabinetAItemId == FileCabinetAItemId);
|
||||
if (fileCabinetAItem != null)
|
||||
{
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(fileCabinetAItem.FileCabinetAItemId);
|
||||
Funs.DB.InformationProject_FileCabinetAItem.DeleteOnSubmit(fileCabinetAItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class FileCabinetAService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据用户id获取文件柜主表列表
|
||||
/// </summary>
|
||||
/// <param name="appraise"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.InformationProject_FileCabinetA> GetFileCabinetAListByProjectId(string projectId)
|
||||
{
|
||||
var FileCabinetAList = from x in Funs.DB.InformationProject_FileCabinetA
|
||||
orderby x.Code
|
||||
where x.ProjectId == projectId
|
||||
select x;
|
||||
return FileCabinetAList.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键id获取文件柜
|
||||
/// </summary>
|
||||
/// <param name="appraise"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_FileCabinetA GetFileCabinetAByID(string FileCabinetAId)
|
||||
{
|
||||
return Funs.DB.InformationProject_FileCabinetA.FirstOrDefault(x => x.FileCabinetAId == FileCabinetAId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据菜单id项目id获取文件柜
|
||||
/// </summary>
|
||||
/// <param name="appraise"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_FileCabinetA GetFileCabinetAByMenuIdProjectId(string MenuId, string ProjectId)
|
||||
{
|
||||
return Funs.DB.InformationProject_FileCabinetA.FirstOrDefault(x => x.MenuId == MenuId && x.ProjectId == ProjectId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加文件柜
|
||||
/// </summary>
|
||||
/// <param name="FileCabinetA"></param>
|
||||
public static void AddFileCabinetA(Model.InformationProject_FileCabinetA FileCabinetA)
|
||||
{
|
||||
Model.InformationProject_FileCabinetA newFileCabinetA = new Model.InformationProject_FileCabinetA
|
||||
{
|
||||
FileCabinetAId = FileCabinetA.FileCabinetAId,
|
||||
ProjectId = FileCabinetA.ProjectId,
|
||||
MenuId = FileCabinetA.MenuId,
|
||||
Code = FileCabinetA.Code,
|
||||
Title = FileCabinetA.Title,
|
||||
SupFileCabinetAId = FileCabinetA.SupFileCabinetAId,
|
||||
IsEndLever = FileCabinetA.IsEndLever
|
||||
};
|
||||
Funs.DB.InformationProject_FileCabinetA.InsertOnSubmit(newFileCabinetA);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改文件柜
|
||||
/// </summary>
|
||||
/// <param name="FileCabinetA"></param>
|
||||
public static void UpdateFileCabinetA(Model.InformationProject_FileCabinetA FileCabinetA)
|
||||
{
|
||||
Model.InformationProject_FileCabinetA newFileCabinetA = Funs.DB.InformationProject_FileCabinetA.FirstOrDefault(e => e.FileCabinetAId == FileCabinetA.FileCabinetAId);
|
||||
if (newFileCabinetA != null)
|
||||
{
|
||||
newFileCabinetA.Code = FileCabinetA.Code;
|
||||
newFileCabinetA.Title = FileCabinetA.Title;
|
||||
newFileCabinetA.SupFileCabinetAId = FileCabinetA.SupFileCabinetAId;
|
||||
newFileCabinetA.IsEndLever = FileCabinetA.IsEndLever;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除信息
|
||||
/// </summary>
|
||||
/// <param name="FileCabinetAId"></param>
|
||||
public static void DeleteFileCabinetAByID(string FileCabinetAId)
|
||||
{
|
||||
Model.InformationProject_FileCabinetA FileCabinetA = Funs.DB.InformationProject_FileCabinetA.FirstOrDefault(e => e.FileCabinetAId == FileCabinetAId);
|
||||
{
|
||||
Funs.DB.InformationProject_FileCabinetA.DeleteOnSubmit(FileCabinetA);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在文件夹名称
|
||||
/// </summary>
|
||||
/// <param name="postName"></param>
|
||||
/// <returns>true-存在,false-不存在</returns>
|
||||
public static bool IsExistTitle(string FileCabinetAId, string supFileCabinetAId, string title)
|
||||
{
|
||||
var q = Funs.DB.InformationProject_FileCabinetA.FirstOrDefault(x => x.SupFileCabinetAId == supFileCabinetAId && x.Title == title
|
||||
&& x.FileCabinetAId != FileCabinetAId);
|
||||
if (q != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否可删除节点
|
||||
/// </summary>
|
||||
/// <param name="postName"></param>
|
||||
/// <returns>true-可以,false-不可以</returns>
|
||||
public static bool IsDeleteFileCabinetA(string FileCabinetAId)
|
||||
{
|
||||
bool isDelete = true;
|
||||
var FileCabinetA = GetFileCabinetAByID(FileCabinetAId);
|
||||
if (FileCabinetA != null)
|
||||
{
|
||||
if (FileCabinetA.IsEndLever == true)
|
||||
{
|
||||
var detailCout = Funs.DB.InformationProject_FileCabinetAItem.FirstOrDefault(x => x.FileCabinetAId == FileCabinetAId);
|
||||
if (detailCout != null)
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var supItemSetCount = Funs.DB.InformationProject_FileCabinetA.FirstOrDefault(x => x.SupFileCabinetAId == FileCabinetAId);
|
||||
if (supItemSetCount != null)
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
#region 页面信息添加到文件柜A
|
||||
#region 添加到文件柜A中方法
|
||||
/// <summary>
|
||||
/// 添加到文件柜A中方法
|
||||
/// </summary>
|
||||
/// <param name="menuId"></param>
|
||||
/// <param name="dataId"></param>
|
||||
/// <param name="content"></param>
|
||||
public static void AddFileCabinetA(string menuId, string dataId, string content, string url, string projectId)
|
||||
{
|
||||
var fileCabinetA = BLL.FileCabinetAService.GetFileCabinetAByMenuIdProjectId(menuId, projectId);
|
||||
if (fileCabinetA != null) ////判断这个菜单id 是否在文件柜A中 在则插入明细 不在则查找上一级菜单id
|
||||
{
|
||||
AddDataToFileCabinetAItem(dataId, content, fileCabinetA.FileCabinetAId, url);
|
||||
}
|
||||
else ///增加改菜单到文件柜A主表 然后增加明细
|
||||
{
|
||||
AddDataToFileCabinetA(menuId, dataId, content, url, projectId);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加到文件柜A中方法
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="menuId"></param>
|
||||
/// <param name="dataId"></param>
|
||||
/// <param name="content"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="projectId"></param>
|
||||
public static void AddDataToFileCabinetA(string menuId, string dataId, string content, string url, string projectId)
|
||||
{
|
||||
var sysMenu = BLL.SysMenuService.GetSysMenuByMenuId(menuId);
|
||||
if (sysMenu != null)
|
||||
{
|
||||
Model.InformationProject_FileCabinetA newFileCabinetA = new Model.InformationProject_FileCabinetA
|
||||
{
|
||||
FileCabinetAId = SQLHelper.GetNewID(typeof(Model.InformationProject_FileCabinetA)),
|
||||
ProjectId = projectId,
|
||||
Code = sysMenu.SortIndex.ToString(),
|
||||
Title = sysMenu.MenuName,
|
||||
MenuId = menuId
|
||||
};
|
||||
if (menuId == "0")
|
||||
{
|
||||
newFileCabinetA.SupFileCabinetAId = "0";
|
||||
}
|
||||
else
|
||||
{
|
||||
newFileCabinetA.SupFileCabinetAId = null;
|
||||
}
|
||||
newFileCabinetA.IsEndLever = sysMenu.IsEnd;
|
||||
BLL.FileCabinetAService.AddFileCabinetA(newFileCabinetA);
|
||||
|
||||
///查询是否存在下级菜单
|
||||
var fileCabinetAList = from x in Funs.DB.InformationProject_FileCabinetA
|
||||
join y in Funs.DB.Sys_Menu on x.MenuId equals y.MenuId
|
||||
where x.SupFileCabinetAId == null && x.ProjectId == projectId && y.SuperMenu == menuId
|
||||
select x;
|
||||
if (fileCabinetAList.Count() > 0)
|
||||
{
|
||||
foreach (var item in fileCabinetAList)
|
||||
{
|
||||
item.SupFileCabinetAId = newFileCabinetA.FileCabinetAId;
|
||||
BLL.FileCabinetAService.UpdateFileCabinetA(item);
|
||||
}
|
||||
}
|
||||
if (sysMenu.IsEnd == true) ///增加明细
|
||||
{
|
||||
AddDataToFileCabinetAItem(dataId, content, newFileCabinetA.FileCabinetAId, url);
|
||||
}
|
||||
var fileCabinetASuper = BLL.FileCabinetAService.GetFileCabinetAByMenuIdProjectId(sysMenu.SuperMenu, projectId);
|
||||
if (fileCabinetASuper == null) ///继续增加上级菜单
|
||||
{
|
||||
AddDataToFileCabinetA(sysMenu.SuperMenu, dataId, content, url, projectId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var fileCabinetASuperList = from x in Funs.DB.InformationProject_FileCabinetA
|
||||
join y in Funs.DB.Sys_Menu on x.MenuId equals y.MenuId
|
||||
where x.ProjectId == projectId && y.SuperMenu == fileCabinetASuper.MenuId && x.SupFileCabinetAId == null
|
||||
select x;
|
||||
if (fileCabinetASuperList.Count() > 0)
|
||||
{
|
||||
foreach (var item in fileCabinetASuperList)
|
||||
{
|
||||
item.SupFileCabinetAId = fileCabinetASuper.FileCabinetAId;
|
||||
BLL.FileCabinetAService.UpdateFileCabinetA(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
///查询是否存在下级菜单
|
||||
var fileCabinetAList = from x in Funs.DB.InformationProject_FileCabinetA
|
||||
where x.SupFileCabinetAId == null && x.ProjectId == projectId
|
||||
select x;
|
||||
if (fileCabinetAList.Count() > 0)
|
||||
{
|
||||
foreach (var item in fileCabinetAList)
|
||||
{
|
||||
item.SupFileCabinetAId = "0";
|
||||
BLL.FileCabinetAService.UpdateFileCabinetA(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加文件柜明细
|
||||
/// <summary>
|
||||
/// 增加文件柜明细
|
||||
/// </summary>
|
||||
public static void AddDataToFileCabinetAItem(string dataId, string content, string fileCabinetAId, string url)
|
||||
{
|
||||
var fileCabinetAItem = BLL.FileCabinetAItemService.GetFileCabinetAItemByID(dataId); ///明细是否存在
|
||||
if (fileCabinetAItem != null)
|
||||
{
|
||||
fileCabinetAItem.Title = content;
|
||||
BLL.FileCabinetAItemService.UpdateFileCabinetAItem(fileCabinetAItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.InformationProject_FileCabinetAItem newFileCabinetAItem = new Model.InformationProject_FileCabinetAItem
|
||||
{
|
||||
FileCabinetAItemId = dataId,
|
||||
FileCabinetAId = fileCabinetAId,
|
||||
Code = BLL.CodeRecordsService.ReturnCodeByDataId(dataId),
|
||||
Title = content,
|
||||
CompileDate = System.DateTime.Now,
|
||||
IsMenu = true,
|
||||
Url = url
|
||||
};
|
||||
BLL.FileCabinetAItemService.AddFileCabinetAItem(newFileCabinetAItem);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Collections;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class LawRegulationIdentifyService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据法律法规辨识编号获取一个法律法规辨识信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationIdentifyCode">法律法规辨识编号</param>
|
||||
/// <returns>一个法律法规辨识实体</returns>
|
||||
public static Model.Law_LawRegulationIdentify GetLawRegulationIdentifyByLawRegulationIdentifyId(string lawRegulationIdentifyId)
|
||||
{
|
||||
return Funs.DB.Law_LawRegulationIdentify.FirstOrDefault(x => x.LawRegulationIdentifyId == lawRegulationIdentifyId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加法律法规辨识信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationIdentify">法律法规辨识实体</param>
|
||||
public static void AddLawRegulationIdentify(Model.Law_LawRegulationIdentify lawRegulationIdentify)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_LawRegulationIdentify newLawRegulationIdentify = new Model.Law_LawRegulationIdentify
|
||||
{
|
||||
LawRegulationIdentifyId = lawRegulationIdentify.LawRegulationIdentifyId,
|
||||
LawRegulationIdentifyCode = lawRegulationIdentify.LawRegulationIdentifyCode,
|
||||
VersionNumber = lawRegulationIdentify.VersionNumber,
|
||||
ProjectId = lawRegulationIdentify.ProjectId,
|
||||
IdentifyPerson = lawRegulationIdentify.IdentifyPerson,
|
||||
IdentifyDate = lawRegulationIdentify.IdentifyDate,
|
||||
ManagerContent = lawRegulationIdentify.ManagerContent,
|
||||
IdentifyConclude = lawRegulationIdentify.IdentifyConclude,
|
||||
States = lawRegulationIdentify.States,
|
||||
GroupMember = lawRegulationIdentify.GroupMember,
|
||||
Remark = lawRegulationIdentify.Remark,
|
||||
UpdateDate = lawRegulationIdentify.UpdateDate
|
||||
};
|
||||
db.Law_LawRegulationIdentify.InsertOnSubmit(newLawRegulationIdentify);
|
||||
db.SubmitChanges();
|
||||
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.LawRegulationIdentifyMenuId, lawRegulationIdentify.ProjectId, null, lawRegulationIdentify.LawRegulationIdentifyId, lawRegulationIdentify.IdentifyDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改法律法规辨识信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationIdentify">法律法规辨识实体</param>
|
||||
public static void UpdateLawRegulationIdentify(Model.Law_LawRegulationIdentify lawRegulationIdentify)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_LawRegulationIdentify newLawRegulationIdentify = db.Law_LawRegulationIdentify.FirstOrDefault(e => e.LawRegulationIdentifyId == lawRegulationIdentify.LawRegulationIdentifyId);
|
||||
if (newLawRegulationIdentify != null)
|
||||
{
|
||||
newLawRegulationIdentify.VersionNumber = lawRegulationIdentify.VersionNumber;
|
||||
newLawRegulationIdentify.ProjectId = lawRegulationIdentify.ProjectId;
|
||||
newLawRegulationIdentify.IdentifyPerson = lawRegulationIdentify.IdentifyPerson;
|
||||
newLawRegulationIdentify.IdentifyDate = lawRegulationIdentify.IdentifyDate;
|
||||
newLawRegulationIdentify.ManagerContent = lawRegulationIdentify.ManagerContent;
|
||||
newLawRegulationIdentify.IdentifyConclude = lawRegulationIdentify.IdentifyConclude;
|
||||
newLawRegulationIdentify.States = lawRegulationIdentify.States;
|
||||
newLawRegulationIdentify.GroupMember = lawRegulationIdentify.GroupMember;
|
||||
newLawRegulationIdentify.Remark = lawRegulationIdentify.Remark;
|
||||
newLawRegulationIdentify.UpdateDate = lawRegulationIdentify.UpdateDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据法律法规辨识编号删除一个法律法规辨识信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationIdentifyCode">法律法规辨识编号</param>
|
||||
public static void DeleteLawRegulationIdentify(string lawRegulationIdentifyId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Law_LawRegulationIdentify lawRegulationIdentify = db.Law_LawRegulationIdentify.FirstOrDefault(e => e.LawRegulationIdentifyId == lawRegulationIdentifyId);
|
||||
if (lawRegulationIdentify != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(lawRegulationIdentifyId);
|
||||
//CommonService.DeleteAttachFileById(lawRegulationIdentifyId);//删除附件
|
||||
ProjectDataFlowSetService.DeleteFlowSetByDataId(lawRegulationIdentifyId);//删除流程
|
||||
////删除审核流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(lawRegulationIdentifyId);
|
||||
db.Law_LawRegulationIdentify.DeleteOnSubmit(lawRegulationIdentify);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Collections;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class LawRegulationSelectedItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据法律法规辨识Id获取对应所有法律法规项信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationIdentifyCode">法律法规辨识Id</param>
|
||||
/// <returns>所有法律法规项信息</returns>
|
||||
public static List<Model.Law_LawRegulationSelectedItem> GetLawRegulationSelectedItemsByLawRegulationIdentifyId(string lawRegulationIdentifyId)
|
||||
{
|
||||
return (from x in Funs.DB.Law_LawRegulationSelectedItem where x.LawRegulationIdentifyId == lawRegulationIdentifyId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加法律法规项信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationSelectedItem">法律法规项实体</param>
|
||||
public static void AddLawRegulationSelectedItem(Model.Law_LawRegulationSelectedItem lawRegulationSelectedItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.Law_LawRegulationSelectedItem));
|
||||
Model.Law_LawRegulationSelectedItem newLawRegulationSelectedItem = new Model.Law_LawRegulationSelectedItem
|
||||
{
|
||||
LawRegulationSelectedItemId = newKeyID,
|
||||
LawRegulationIdentifyId = lawRegulationSelectedItem.LawRegulationIdentifyId,
|
||||
LawRegulationId = lawRegulationSelectedItem.LawRegulationId,
|
||||
LawRegulationGrade = lawRegulationSelectedItem.LawRegulationGrade,
|
||||
FitPerfomance = lawRegulationSelectedItem.FitPerfomance
|
||||
};
|
||||
|
||||
db.Law_LawRegulationSelectedItem.InsertOnSubmit(newLawRegulationSelectedItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据法律法规辨识主键删除对应的所有法律法规项信息
|
||||
/// </summary>
|
||||
/// <param name="lawRegulationIdentifyCode">法律法规辨识主键</param>
|
||||
public static void DeleteLawRegulationSelectedItemByLawRegulationIdentifyId(string lawRegulationIdentifyId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.Law_LawRegulationSelectedItem where x.LawRegulationIdentifyId == lawRegulationIdentifyId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.Law_LawRegulationSelectedItem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 职工伤亡事故原因分析报明细表
|
||||
/// </summary>
|
||||
public static class ProjectAccidentCauseReportItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 职工伤亡事故原因分析报表明细表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId">职工伤亡事故原因分析报表明细表Id</param>
|
||||
/// <returns>职工伤亡事故原因分析报表明细表</returns>
|
||||
public static Model.InformationProject_AccidentCauseReportItem GetAccidentCauseReportItemById(string AccidentCauseReportItemId)
|
||||
{
|
||||
return Funs.DB.InformationProject_AccidentCauseReportItem.FirstOrDefault(e => e.AccidentCauseReportItemId == AccidentCauseReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加职工伤亡事故原因分析报表明细表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItem">职工伤亡事故原因分析报表明细表实体</param>
|
||||
public static void AddAccidentCauseReportItem(Model.InformationProject_AccidentCauseReportItem AccidentCauseReportItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_AccidentCauseReportItem newAccidentCauseReportItem = new Model.InformationProject_AccidentCauseReportItem
|
||||
{
|
||||
AccidentCauseReportItemId = AccidentCauseReportItem.AccidentCauseReportItemId,
|
||||
AccidentCauseReportId = AccidentCauseReportItem.AccidentCauseReportId,
|
||||
AccidentType = AccidentCauseReportItem.AccidentType,
|
||||
TotalDeath = AccidentCauseReportItem.TotalDeath,
|
||||
TotalInjuries = AccidentCauseReportItem.TotalInjuries,
|
||||
TotalMinorInjuries = AccidentCauseReportItem.TotalMinorInjuries,
|
||||
Death1 = AccidentCauseReportItem.Death1,
|
||||
Injuries1 = AccidentCauseReportItem.Injuries1,
|
||||
MinorInjuries1 = AccidentCauseReportItem.MinorInjuries1,
|
||||
Death2 = AccidentCauseReportItem.Death2,
|
||||
Injuries2 = AccidentCauseReportItem.Injuries2,
|
||||
MinorInjuries2 = AccidentCauseReportItem.MinorInjuries2,
|
||||
Death3 = AccidentCauseReportItem.Death3,
|
||||
Injuries3 = AccidentCauseReportItem.Injuries3,
|
||||
MinorInjuries3 = AccidentCauseReportItem.MinorInjuries3,
|
||||
Death4 = AccidentCauseReportItem.Death4,
|
||||
Injuries4 = AccidentCauseReportItem.Injuries4,
|
||||
MinorInjuries4 = AccidentCauseReportItem.MinorInjuries4,
|
||||
Death5 = AccidentCauseReportItem.Death5,
|
||||
Injuries5 = AccidentCauseReportItem.Injuries5,
|
||||
MinorInjuries5 = AccidentCauseReportItem.MinorInjuries5,
|
||||
Death6 = AccidentCauseReportItem.Death6,
|
||||
Injuries6 = AccidentCauseReportItem.Injuries6,
|
||||
MinorInjuries6 = AccidentCauseReportItem.MinorInjuries6,
|
||||
Death7 = AccidentCauseReportItem.Death7,
|
||||
Injuries7 = AccidentCauseReportItem.Injuries7,
|
||||
MinorInjuries7 = AccidentCauseReportItem.MinorInjuries7,
|
||||
Death8 = AccidentCauseReportItem.Death8,
|
||||
Injuries8 = AccidentCauseReportItem.Injuries8,
|
||||
MinorInjuries8 = AccidentCauseReportItem.MinorInjuries8,
|
||||
Death9 = AccidentCauseReportItem.Death9,
|
||||
Injuries9 = AccidentCauseReportItem.Injuries9,
|
||||
MinorInjuries9 = AccidentCauseReportItem.MinorInjuries9,
|
||||
Death10 = AccidentCauseReportItem.Death10,
|
||||
Injuries10 = AccidentCauseReportItem.Injuries10,
|
||||
MinorInjuries10 = AccidentCauseReportItem.MinorInjuries10,
|
||||
Death11 = AccidentCauseReportItem.Death11,
|
||||
Injuries11 = AccidentCauseReportItem.Injuries11,
|
||||
MinorInjuries11 = AccidentCauseReportItem.MinorInjuries11
|
||||
};
|
||||
|
||||
db.InformationProject_AccidentCauseReportItem.InsertOnSubmit(newAccidentCauseReportItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改职工伤亡事故原因分析报表明细表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItem">职工伤亡事故原因分析报表明细表实体</param>
|
||||
public static void UpdateAccidentCauseReportItem(Model.InformationProject_AccidentCauseReportItem AccidentCauseReportItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_AccidentCauseReportItem newAccidentCauseReportItem = db.InformationProject_AccidentCauseReportItem.FirstOrDefault(e => e.AccidentCauseReportItemId == AccidentCauseReportItem.AccidentCauseReportItemId);
|
||||
newAccidentCauseReportItem.AccidentType = AccidentCauseReportItem.AccidentType;
|
||||
newAccidentCauseReportItem.TotalDeath = AccidentCauseReportItem.TotalDeath;
|
||||
newAccidentCauseReportItem.TotalInjuries = AccidentCauseReportItem.TotalInjuries;
|
||||
newAccidentCauseReportItem.TotalMinorInjuries = AccidentCauseReportItem.TotalMinorInjuries;
|
||||
newAccidentCauseReportItem.Death1 = AccidentCauseReportItem.Death1;
|
||||
newAccidentCauseReportItem.Injuries1 = AccidentCauseReportItem.Injuries1;
|
||||
newAccidentCauseReportItem.MinorInjuries1 = AccidentCauseReportItem.MinorInjuries1;
|
||||
newAccidentCauseReportItem.Death2 = AccidentCauseReportItem.Death2;
|
||||
newAccidentCauseReportItem.Injuries2 = AccidentCauseReportItem.Injuries2;
|
||||
newAccidentCauseReportItem.MinorInjuries2 = AccidentCauseReportItem.MinorInjuries2;
|
||||
newAccidentCauseReportItem.Death3 = AccidentCauseReportItem.Death3;
|
||||
newAccidentCauseReportItem.Injuries3 = AccidentCauseReportItem.Injuries3;
|
||||
newAccidentCauseReportItem.MinorInjuries3 = AccidentCauseReportItem.MinorInjuries3;
|
||||
newAccidentCauseReportItem.Death4 = AccidentCauseReportItem.Death4;
|
||||
newAccidentCauseReportItem.Injuries4 = AccidentCauseReportItem.Injuries4;
|
||||
newAccidentCauseReportItem.MinorInjuries4 = AccidentCauseReportItem.MinorInjuries4;
|
||||
newAccidentCauseReportItem.Death5 = AccidentCauseReportItem.Death5;
|
||||
newAccidentCauseReportItem.Injuries5 = AccidentCauseReportItem.Injuries5;
|
||||
newAccidentCauseReportItem.MinorInjuries5 = AccidentCauseReportItem.MinorInjuries5;
|
||||
newAccidentCauseReportItem.Death6 = AccidentCauseReportItem.Death6;
|
||||
newAccidentCauseReportItem.Injuries6 = AccidentCauseReportItem.Injuries6;
|
||||
newAccidentCauseReportItem.MinorInjuries6 = AccidentCauseReportItem.MinorInjuries6;
|
||||
newAccidentCauseReportItem.Death7 = AccidentCauseReportItem.Death7;
|
||||
newAccidentCauseReportItem.Injuries7 = AccidentCauseReportItem.Injuries7;
|
||||
newAccidentCauseReportItem.MinorInjuries7 = AccidentCauseReportItem.MinorInjuries7;
|
||||
newAccidentCauseReportItem.Death8 = AccidentCauseReportItem.Death8;
|
||||
newAccidentCauseReportItem.Injuries8 = AccidentCauseReportItem.Injuries8;
|
||||
newAccidentCauseReportItem.MinorInjuries8 = AccidentCauseReportItem.MinorInjuries8;
|
||||
newAccidentCauseReportItem.Death9 = AccidentCauseReportItem.Death9;
|
||||
newAccidentCauseReportItem.Injuries9 = AccidentCauseReportItem.Injuries9;
|
||||
newAccidentCauseReportItem.MinorInjuries9 = AccidentCauseReportItem.MinorInjuries9;
|
||||
newAccidentCauseReportItem.Death10 = AccidentCauseReportItem.Death10;
|
||||
newAccidentCauseReportItem.Injuries10 = AccidentCauseReportItem.Injuries10;
|
||||
newAccidentCauseReportItem.MinorInjuries10 = AccidentCauseReportItem.MinorInjuries10;
|
||||
newAccidentCauseReportItem.Death11 = AccidentCauseReportItem.Death11;
|
||||
newAccidentCauseReportItem.Injuries11 = AccidentCauseReportItem.Injuries11;
|
||||
newAccidentCauseReportItem.MinorInjuries11 = AccidentCauseReportItem.MinorInjuries11;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id删除所有数据
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId"></param>
|
||||
public static void DeleteAccidentCauseReportItemByAccidentCauseReportId(string AccidentCauseReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = from x in db.InformationProject_AccidentCauseReportItem where x.AccidentCauseReportId == AccidentCauseReportId select x;
|
||||
if (q != null)
|
||||
{
|
||||
db.InformationProject_AccidentCauseReportItem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含总计行)
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId">职工伤亡事故原因分析报表明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.InformationProject_AccidentCauseReportItem> GetItemsNoSum(string AccidentCauseReportId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
return (from x in db.InformationProject_AccidentCauseReportItem
|
||||
join y in db.Sys_Const on x.AccidentType equals y.ConstText
|
||||
where x.AccidentCauseReportId == AccidentCauseReportId && x.AccidentType != "总计" && y.GroupId == ConstValue.Group_0012
|
||||
orderby y.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 职工伤亡事故原因分析报
|
||||
/// </summary>
|
||||
public static class ProjectAccidentCauseReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 职工伤亡事故原因分析报表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportId">职工伤亡事故原因分析报表Id</param>
|
||||
/// <returns>职工伤亡事故原因分析报表</returns>
|
||||
public static Model.InformationProject_AccidentCauseReport GetAccidentCauseReportById(string accidentCauseReportId)
|
||||
{
|
||||
return Funs.DB.InformationProject_AccidentCauseReport.FirstOrDefault(e => e.AccidentCauseReportId == accidentCauseReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加职工伤亡事故原因分析报表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReport">职工伤亡事故原因分析报表实体</param>
|
||||
public static void AddAccidentCauseReport(Model.InformationProject_AccidentCauseReport AccidentCauseReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_AccidentCauseReport newAccidentCauseReport = new Model.InformationProject_AccidentCauseReport
|
||||
{
|
||||
AccidentCauseReportId = AccidentCauseReport.AccidentCauseReportId,
|
||||
ProjectId = AccidentCauseReport.ProjectId,
|
||||
AccidentCauseReportCode = AccidentCauseReport.AccidentCauseReportCode,
|
||||
Year = AccidentCauseReport.Year,
|
||||
Month = AccidentCauseReport.Month,
|
||||
UnitId = AccidentCauseReport.UnitId,
|
||||
DeathAccident = AccidentCauseReport.DeathAccident,
|
||||
DeathToll = AccidentCauseReport.DeathToll,
|
||||
InjuredAccident = AccidentCauseReport.InjuredAccident,
|
||||
InjuredToll = AccidentCauseReport.InjuredToll,
|
||||
MinorWoundAccident = AccidentCauseReport.MinorWoundAccident,
|
||||
MinorWoundToll = AccidentCauseReport.MinorWoundToll,
|
||||
AverageTotalHours = AccidentCauseReport.AverageTotalHours,
|
||||
AverageManHours = AccidentCauseReport.AverageManHours,
|
||||
TotalLossMan = AccidentCauseReport.TotalLossMan,
|
||||
LastMonthLossHoursTotal = AccidentCauseReport.LastMonthLossHoursTotal,
|
||||
KnockOffTotal = AccidentCauseReport.KnockOffTotal,
|
||||
DirectLoss = AccidentCauseReport.DirectLoss,
|
||||
IndirectLosses = AccidentCauseReport.IndirectLosses,
|
||||
TotalLoss = AccidentCauseReport.TotalLoss,
|
||||
TotalLossTime = AccidentCauseReport.TotalLossTime,
|
||||
CompileMan = AccidentCauseReport.CompileMan,
|
||||
CompileDate = AccidentCauseReport.CompileDate,
|
||||
States = AccidentCauseReport.States
|
||||
};
|
||||
|
||||
db.InformationProject_AccidentCauseReport.InsertOnSubmit(newAccidentCauseReport);
|
||||
db.SubmitChanges();
|
||||
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectAccidentCauseReportMenuId, AccidentCauseReport.ProjectId, null, AccidentCauseReport.AccidentCauseReportId, AccidentCauseReport.CompileDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改职工伤亡事故原因分析报表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReport">职工伤亡事故原因分析报表实体</param>
|
||||
public static void UpdateAccidentCauseReport(Model.InformationProject_AccidentCauseReport AccidentCauseReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_AccidentCauseReport newAccidentCauseReport = db.InformationProject_AccidentCauseReport.FirstOrDefault(e => e.AccidentCauseReportId == AccidentCauseReport.AccidentCauseReportId);
|
||||
if (newAccidentCauseReport != null)
|
||||
{
|
||||
newAccidentCauseReport.ProjectId = AccidentCauseReport.ProjectId;
|
||||
newAccidentCauseReport.AccidentCauseReportCode = AccidentCauseReport.AccidentCauseReportCode;
|
||||
newAccidentCauseReport.Year = AccidentCauseReport.Year;
|
||||
newAccidentCauseReport.Month = AccidentCauseReport.Month;
|
||||
newAccidentCauseReport.UnitId = AccidentCauseReport.UnitId;
|
||||
newAccidentCauseReport.DeathAccident = AccidentCauseReport.DeathAccident;
|
||||
newAccidentCauseReport.DeathToll = AccidentCauseReport.DeathToll;
|
||||
newAccidentCauseReport.InjuredAccident = AccidentCauseReport.InjuredAccident;
|
||||
newAccidentCauseReport.InjuredToll = AccidentCauseReport.InjuredToll;
|
||||
newAccidentCauseReport.MinorWoundAccident = AccidentCauseReport.MinorWoundAccident;
|
||||
newAccidentCauseReport.MinorWoundToll = AccidentCauseReport.MinorWoundToll;
|
||||
newAccidentCauseReport.AverageTotalHours = AccidentCauseReport.AverageTotalHours;
|
||||
newAccidentCauseReport.AverageManHours = AccidentCauseReport.AverageManHours;
|
||||
newAccidentCauseReport.TotalLossMan = AccidentCauseReport.TotalLossMan;
|
||||
newAccidentCauseReport.LastMonthLossHoursTotal = AccidentCauseReport.LastMonthLossHoursTotal;
|
||||
newAccidentCauseReport.KnockOffTotal = AccidentCauseReport.KnockOffTotal;
|
||||
newAccidentCauseReport.DirectLoss = AccidentCauseReport.DirectLoss;
|
||||
newAccidentCauseReport.IndirectLosses = AccidentCauseReport.IndirectLosses;
|
||||
newAccidentCauseReport.TotalLoss = AccidentCauseReport.TotalLoss;
|
||||
newAccidentCauseReport.TotalLossTime = AccidentCauseReport.TotalLossTime;
|
||||
newAccidentCauseReport.CompileMan = AccidentCauseReport.CompileMan;
|
||||
newAccidentCauseReport.CompileDate = AccidentCauseReport.CompileDate;
|
||||
newAccidentCauseReport.States = AccidentCauseReport.States;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取数据
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportId"></param>
|
||||
public static void DeleteAccidentCauseReportById(string AccidentCauseReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_AccidentCauseReport newAccidentCauseReport = db.InformationProject_AccidentCauseReport.FirstOrDefault(e => e.AccidentCauseReportId == AccidentCauseReportId);
|
||||
if (newAccidentCauseReport != null)
|
||||
{
|
||||
CodeRecordsService.DeleteCodeRecordsByDataId(AccidentCauseReportId);
|
||||
CommonService.DeleteFlowOperateByID(AccidentCauseReportId);
|
||||
db.InformationProject_AccidentCauseReport.DeleteOnSubmit(newAccidentCauseReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练开展情况季报明细
|
||||
/// </summary>
|
||||
public static class ProjectDrillConductedQuarterlyReportItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练开展情况季报表明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_DrillConductedQuarterlyReportItem GetDrillConductedQuarterlyReportItemById(string drillConductedQuarterlyReportItemId)
|
||||
{
|
||||
return Funs.DB.InformationProject_DrillConductedQuarterlyReportItem.FirstOrDefault(e => e.DrillConductedQuarterlyReportItemId == drillConductedQuarterlyReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应急演练开展情况季报Id获取所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.InformationProject_DrillConductedQuarterlyReportItem> GetDrillConductedQuarterlyReportItemList(string drillConductedQuarterlyReportId)
|
||||
{
|
||||
return (from x in Funs.DB.InformationProject_DrillConductedQuarterlyReportItem where x.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId orderby x.SortIndex select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应急演练开展情况季报明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportItem"></param>
|
||||
public static void AddDrillConductedQuarterlyReportItem(Model.InformationProject_DrillConductedQuarterlyReportItem drillConductedQuarterlyReportItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillConductedQuarterlyReportItem newDrillConductedQuarterlyReportItem = new Model.InformationProject_DrillConductedQuarterlyReportItem
|
||||
{
|
||||
DrillConductedQuarterlyReportItemId = drillConductedQuarterlyReportItem.DrillConductedQuarterlyReportItemId,
|
||||
DrillConductedQuarterlyReportId = drillConductedQuarterlyReportItem.DrillConductedQuarterlyReportId,
|
||||
IndustryType = drillConductedQuarterlyReportItem.IndustryType,
|
||||
TotalConductCount = drillConductedQuarterlyReportItem.TotalConductCount,
|
||||
TotalPeopleCount = drillConductedQuarterlyReportItem.TotalPeopleCount,
|
||||
TotalInvestment = drillConductedQuarterlyReportItem.TotalInvestment,
|
||||
HQConductCount = drillConductedQuarterlyReportItem.HQConductCount,
|
||||
HQPeopleCount = drillConductedQuarterlyReportItem.HQPeopleCount,
|
||||
HQInvestment = drillConductedQuarterlyReportItem.HQInvestment,
|
||||
BasicConductCount = drillConductedQuarterlyReportItem.BasicConductCount,
|
||||
BasicPeopleCount = drillConductedQuarterlyReportItem.BasicPeopleCount,
|
||||
BasicInvestment = drillConductedQuarterlyReportItem.BasicInvestment,
|
||||
ComprehensivePractice = drillConductedQuarterlyReportItem.ComprehensivePractice,
|
||||
CPScene = drillConductedQuarterlyReportItem.CPScene,
|
||||
CPDesktop = drillConductedQuarterlyReportItem.CPDesktop,
|
||||
SpecialDrill = drillConductedQuarterlyReportItem.SpecialDrill,
|
||||
SDScene = drillConductedQuarterlyReportItem.SDScene,
|
||||
SDDesktop = drillConductedQuarterlyReportItem.SDDesktop,
|
||||
SortIndex = drillConductedQuarterlyReportItem.SortIndex
|
||||
};
|
||||
db.InformationProject_DrillConductedQuarterlyReportItem.InsertOnSubmit(newDrillConductedQuarterlyReportItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改应急演练开展情况季报明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportItem"></param>
|
||||
public static void UpdateDrillConductedQuarterlyReportItem(Model.InformationProject_DrillConductedQuarterlyReportItem drillConductedQuarterlyReportItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillConductedQuarterlyReportItem newDrillConductedQuarterlyReportItem = db.InformationProject_DrillConductedQuarterlyReportItem.FirstOrDefault(e => e.DrillConductedQuarterlyReportItemId == drillConductedQuarterlyReportItem.DrillConductedQuarterlyReportItemId);
|
||||
if (newDrillConductedQuarterlyReportItem != null)
|
||||
{
|
||||
newDrillConductedQuarterlyReportItem.IndustryType = drillConductedQuarterlyReportItem.IndustryType;
|
||||
newDrillConductedQuarterlyReportItem.TotalConductCount = drillConductedQuarterlyReportItem.TotalConductCount;
|
||||
newDrillConductedQuarterlyReportItem.TotalPeopleCount = drillConductedQuarterlyReportItem.TotalPeopleCount;
|
||||
newDrillConductedQuarterlyReportItem.TotalInvestment = drillConductedQuarterlyReportItem.TotalInvestment;
|
||||
newDrillConductedQuarterlyReportItem.HQConductCount = drillConductedQuarterlyReportItem.HQConductCount;
|
||||
newDrillConductedQuarterlyReportItem.HQPeopleCount = drillConductedQuarterlyReportItem.HQPeopleCount;
|
||||
newDrillConductedQuarterlyReportItem.HQInvestment = drillConductedQuarterlyReportItem.HQInvestment;
|
||||
newDrillConductedQuarterlyReportItem.BasicConductCount = drillConductedQuarterlyReportItem.BasicConductCount;
|
||||
newDrillConductedQuarterlyReportItem.BasicPeopleCount = drillConductedQuarterlyReportItem.BasicPeopleCount;
|
||||
newDrillConductedQuarterlyReportItem.BasicInvestment = drillConductedQuarterlyReportItem.BasicInvestment;
|
||||
newDrillConductedQuarterlyReportItem.ComprehensivePractice = drillConductedQuarterlyReportItem.ComprehensivePractice;
|
||||
newDrillConductedQuarterlyReportItem.CPScene = drillConductedQuarterlyReportItem.CPScene;
|
||||
newDrillConductedQuarterlyReportItem.CPDesktop = drillConductedQuarterlyReportItem.CPDesktop;
|
||||
newDrillConductedQuarterlyReportItem.SpecialDrill = drillConductedQuarterlyReportItem.SpecialDrill;
|
||||
newDrillConductedQuarterlyReportItem.SDScene = drillConductedQuarterlyReportItem.SDScene;
|
||||
newDrillConductedQuarterlyReportItem.SDDesktop = drillConductedQuarterlyReportItem.SDDesktop;
|
||||
newDrillConductedQuarterlyReportItem.SortIndex = drillConductedQuarterlyReportItem.SortIndex;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除应急演练开展情况季报明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportItemId"></param>
|
||||
public static void DeleteDrillConductedQuarterlyReportItemById(string drillConductedQuarterlyReportItemId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillConductedQuarterlyReportItem drillConductedQuarterlyReportItem = db.InformationProject_DrillConductedQuarterlyReportItem.FirstOrDefault(e => e.DrillConductedQuarterlyReportItemId == drillConductedQuarterlyReportItemId);
|
||||
if (drillConductedQuarterlyReportItem != null)
|
||||
{
|
||||
db.InformationProject_DrillConductedQuarterlyReportItem.DeleteOnSubmit(drillConductedQuarterlyReportItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应急演练开展情况季报主表id删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportId"></param>
|
||||
public static void DeleteDrillConductedQuarterlyReportItemList(string drillConductedQuarterlyReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.InformationProject_DrillConductedQuarterlyReportItem where x.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
db.InformationProject_DrillConductedQuarterlyReportItem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练开展情况季报
|
||||
/// </summary>
|
||||
public static class ProjectDrillConductedQuarterlyReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_DrillConductedQuarterlyReport GetDrillConductedQuarterlyReportById(string drillConductedQuarterlyReportId)
|
||||
{
|
||||
return Funs.DB.InformationProject_DrillConductedQuarterlyReport.FirstOrDefault(e => e.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReport"></param>
|
||||
public static void AddDrillConductedQuarterlyReport(Model.InformationProject_DrillConductedQuarterlyReport drillConductedQuarterlyReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillConductedQuarterlyReport newDrillConductedQuarterlyReport = new Model.InformationProject_DrillConductedQuarterlyReport
|
||||
{
|
||||
DrillConductedQuarterlyReportId = drillConductedQuarterlyReport.DrillConductedQuarterlyReportId,
|
||||
ProjectId = drillConductedQuarterlyReport.ProjectId,
|
||||
UnitId = drillConductedQuarterlyReport.UnitId,
|
||||
YearId = drillConductedQuarterlyReport.YearId,
|
||||
Quarter = drillConductedQuarterlyReport.Quarter,
|
||||
CompileMan = drillConductedQuarterlyReport.CompileMan,
|
||||
CompileDate = drillConductedQuarterlyReport.CompileDate,
|
||||
States = drillConductedQuarterlyReport.States
|
||||
};
|
||||
db.InformationProject_DrillConductedQuarterlyReport.InsertOnSubmit(newDrillConductedQuarterlyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReport"></param>
|
||||
public static void UpdateDrillConductedQuarterlyReport(Model.InformationProject_DrillConductedQuarterlyReport drillConductedQuarterlyReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillConductedQuarterlyReport newDrillConductedQuarterlyReport = db.InformationProject_DrillConductedQuarterlyReport.FirstOrDefault(e => e.DrillConductedQuarterlyReportId == drillConductedQuarterlyReport.DrillConductedQuarterlyReportId);
|
||||
if (newDrillConductedQuarterlyReport != null)
|
||||
{
|
||||
newDrillConductedQuarterlyReport.ProjectId = drillConductedQuarterlyReport.ProjectId;
|
||||
newDrillConductedQuarterlyReport.UnitId = drillConductedQuarterlyReport.UnitId;
|
||||
newDrillConductedQuarterlyReport.YearId = drillConductedQuarterlyReport.YearId;
|
||||
newDrillConductedQuarterlyReport.Quarter = drillConductedQuarterlyReport.Quarter;
|
||||
newDrillConductedQuarterlyReport.CompileMan = drillConductedQuarterlyReport.CompileMan;
|
||||
newDrillConductedQuarterlyReport.CompileDate = drillConductedQuarterlyReport.CompileDate;
|
||||
newDrillConductedQuarterlyReport.States = drillConductedQuarterlyReport.States;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportId"></param>
|
||||
public static void DeleteDrillConductedQuarterlyReportById(string drillConductedQuarterlyReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillConductedQuarterlyReport drillConductedQuarterlyReport = db.InformationProject_DrillConductedQuarterlyReport.FirstOrDefault(e => e.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId);
|
||||
if (drillConductedQuarterlyReport != null)
|
||||
{
|
||||
CommonService.DeleteFlowOperateByID(drillConductedQuarterlyReportId);
|
||||
db.InformationProject_DrillConductedQuarterlyReport.DeleteOnSubmit(drillConductedQuarterlyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练工作计划半年报明细
|
||||
/// </summary>
|
||||
public static class ProjectDrillPlanHalfYearReportItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练工作计划半年报明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_DrillPlanHalfYearReportItem GetDrillPlanHalfYearReportItemById(string drillPlanHalfYearReportItemId)
|
||||
{
|
||||
return Funs.DB.InformationProject_DrillPlanHalfYearReportItem.FirstOrDefault(e => e.DrillPlanHalfYearReportItemId == drillPlanHalfYearReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应急演练工作计划半年报Id获取所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.InformationProject_DrillPlanHalfYearReportItem> GetDrillPlanHalfYearReportItemList(string drillPlanHalfYearReportId)
|
||||
{
|
||||
return (from x in Funs.DB.InformationProject_DrillPlanHalfYearReportItem where x.DrillPlanHalfYearReportId == drillPlanHalfYearReportId orderby x.SortIndex select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportItem"></param>
|
||||
public static void AddDrillPlanHalfYearReportItem(Model.InformationProject_DrillPlanHalfYearReportItem drillPlanHalfYearReportItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillPlanHalfYearReportItem newDrillPlanHalfYearReportItem = new Model.InformationProject_DrillPlanHalfYearReportItem
|
||||
{
|
||||
DrillPlanHalfYearReportItemId = drillPlanHalfYearReportItem.DrillPlanHalfYearReportItemId,
|
||||
DrillPlanHalfYearReportId = drillPlanHalfYearReportItem.DrillPlanHalfYearReportId,
|
||||
DrillPlanName = drillPlanHalfYearReportItem.DrillPlanName,
|
||||
OrganizationUnit = drillPlanHalfYearReportItem.OrganizationUnit,
|
||||
DrillPlanDate = drillPlanHalfYearReportItem.DrillPlanDate,
|
||||
AccidentScene = drillPlanHalfYearReportItem.AccidentScene,
|
||||
ExerciseWay = drillPlanHalfYearReportItem.ExerciseWay,
|
||||
SortIndex = drillPlanHalfYearReportItem.SortIndex
|
||||
};
|
||||
db.InformationProject_DrillPlanHalfYearReportItem.InsertOnSubmit(newDrillPlanHalfYearReportItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportItem"></param>
|
||||
public static void UpdateDrillPlanHalfYearReportItem(Model.InformationProject_DrillPlanHalfYearReportItem drillPlanHalfYearReportItem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillPlanHalfYearReportItem newDrillPlanHalfYearReportItem = db.InformationProject_DrillPlanHalfYearReportItem.FirstOrDefault(e => e.DrillPlanHalfYearReportItemId == drillPlanHalfYearReportItem.DrillPlanHalfYearReportItemId);
|
||||
if (newDrillPlanHalfYearReportItem != null)
|
||||
{
|
||||
newDrillPlanHalfYearReportItem.DrillPlanName = drillPlanHalfYearReportItem.DrillPlanName;
|
||||
newDrillPlanHalfYearReportItem.OrganizationUnit = drillPlanHalfYearReportItem.OrganizationUnit;
|
||||
newDrillPlanHalfYearReportItem.DrillPlanDate = drillPlanHalfYearReportItem.DrillPlanDate;
|
||||
newDrillPlanHalfYearReportItem.AccidentScene = drillPlanHalfYearReportItem.AccidentScene;
|
||||
newDrillPlanHalfYearReportItem.ExerciseWay = drillPlanHalfYearReportItem.ExerciseWay;
|
||||
newDrillPlanHalfYearReportItem.SortIndex = drillPlanHalfYearReportItem.SortIndex;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportItemId"></param>
|
||||
public static void DeleteDrillPlanHalfYearReportItemById(string drillPlanHalfYearReportItemId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillPlanHalfYearReportItem drillPlanHalfYearReportItem = db.InformationProject_DrillPlanHalfYearReportItem.FirstOrDefault(e => e.DrillPlanHalfYearReportItemId == drillPlanHalfYearReportItemId);
|
||||
if (drillPlanHalfYearReportItem != null)
|
||||
{
|
||||
db.InformationProject_DrillPlanHalfYearReportItem.DeleteOnSubmit(drillPlanHalfYearReportItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表主键删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportId"></param>
|
||||
public static void DeleteDrillPlanHalfYearReportItemList(string drillPlanHalfYearReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.InformationProject_DrillPlanHalfYearReportItem where x.DrillPlanHalfYearReportId == drillPlanHalfYearReportId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
db.InformationProject_DrillPlanHalfYearReportItem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练工作计划半年报
|
||||
/// </summary>
|
||||
public static class ProjectDrillPlanHalfYearReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_DrillPlanHalfYearReport GetDrillPlanHalfYearReportById(string drillPlanHalfYearReportId)
|
||||
{
|
||||
return Funs.DB.InformationProject_DrillPlanHalfYearReport.FirstOrDefault(e => e.DrillPlanHalfYearReportId == drillPlanHalfYearReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReport"></param>
|
||||
public static void AddDrillPlanHalfYearReport(Model.InformationProject_DrillPlanHalfYearReport drillPlanHalfYearReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillPlanHalfYearReport newDrillPlanHalfYearReport = new Model.InformationProject_DrillPlanHalfYearReport
|
||||
{
|
||||
DrillPlanHalfYearReportId = drillPlanHalfYearReport.DrillPlanHalfYearReportId,
|
||||
ProjectId = drillPlanHalfYearReport.ProjectId,
|
||||
UnitId = drillPlanHalfYearReport.UnitId,
|
||||
YearId = drillPlanHalfYearReport.YearId,
|
||||
HalfYearId = drillPlanHalfYearReport.HalfYearId,
|
||||
Telephone = drillPlanHalfYearReport.Telephone,
|
||||
CompileMan = drillPlanHalfYearReport.CompileMan,
|
||||
CompileDate = drillPlanHalfYearReport.CompileDate,
|
||||
States = drillPlanHalfYearReport.States
|
||||
};
|
||||
db.InformationProject_DrillPlanHalfYearReport.InsertOnSubmit(newDrillPlanHalfYearReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReport"></param>
|
||||
public static void UpdateDrillPlanHalfYearReport(Model.InformationProject_DrillPlanHalfYearReport drillPlanHalfYearReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillPlanHalfYearReport newDrillPlanHalfYearReport = db.InformationProject_DrillPlanHalfYearReport.FirstOrDefault(e => e.DrillPlanHalfYearReportId == drillPlanHalfYearReport.DrillPlanHalfYearReportId);
|
||||
if (newDrillPlanHalfYearReport != null)
|
||||
{
|
||||
newDrillPlanHalfYearReport.ProjectId = drillPlanHalfYearReport.ProjectId;
|
||||
newDrillPlanHalfYearReport.UnitId = drillPlanHalfYearReport.UnitId;
|
||||
newDrillPlanHalfYearReport.YearId = drillPlanHalfYearReport.YearId;
|
||||
newDrillPlanHalfYearReport.HalfYearId = drillPlanHalfYearReport.HalfYearId;
|
||||
newDrillPlanHalfYearReport.Telephone = drillPlanHalfYearReport.Telephone;
|
||||
newDrillPlanHalfYearReport.CompileMan = drillPlanHalfYearReport.CompileMan;
|
||||
newDrillPlanHalfYearReport.CompileDate = drillPlanHalfYearReport.CompileDate;
|
||||
newDrillPlanHalfYearReport.States = drillPlanHalfYearReport.States;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportId"></param>
|
||||
public static void DeleteDrillPlanHalfYearReportById(string drillPlanHalfYearReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_DrillPlanHalfYearReport drillPlanHalfYearReport = db.InformationProject_DrillPlanHalfYearReport.FirstOrDefault(e => e.DrillPlanHalfYearReportId == drillPlanHalfYearReportId);
|
||||
if (drillPlanHalfYearReport != null)
|
||||
{
|
||||
CommonService.DeleteFlowOperateByID(drillPlanHalfYearReportId);
|
||||
db.InformationProject_DrillPlanHalfYearReport.DeleteOnSubmit(drillPlanHalfYearReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class ProjectFolderItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键id获取项目明细
|
||||
/// </summary>
|
||||
/// <param name="appraise"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_ProjectFolderItem GetProjectFolderItemByID(string projectFolderItemId)
|
||||
{
|
||||
return Funs.DB.InformationProject_ProjectFolderItem.FirstOrDefault(x => x.ProjectFolderItemId == projectFolderItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加项目文件
|
||||
/// </summary>
|
||||
/// <param name="projectFolderItem"></param>
|
||||
public static void AddProjectFolderItem(Model.InformationProject_ProjectFolderItem projectFolderItem)
|
||||
{
|
||||
Model.InformationProject_ProjectFolderItem newProjectFolderItem = new Model.InformationProject_ProjectFolderItem
|
||||
{
|
||||
ProjectFolderItemId = projectFolderItem.ProjectFolderItemId,
|
||||
ProjectFolderId = projectFolderItem.ProjectFolderId,
|
||||
Code = projectFolderItem.Code,
|
||||
Title = projectFolderItem.Title,
|
||||
FileContent = projectFolderItem.FileContent,
|
||||
CompileMan = projectFolderItem.CompileMan,
|
||||
CompileDate = projectFolderItem.CompileDate,
|
||||
AttachUrl = projectFolderItem.AttachUrl
|
||||
};
|
||||
Funs.DB.InformationProject_ProjectFolderItem.InsertOnSubmit(newProjectFolderItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
var projecFolder = BLL.ProjectFolderService.GetProjectFolderByID(projectFolderItem.ProjectFolderId);
|
||||
if (projecFolder != null)
|
||||
{
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectFolderMenuId, projecFolder.ProjectId, null, newProjectFolderItem.ProjectFolderItemId, newProjectFolderItem.CompileDate);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改项目文件
|
||||
/// </summary>
|
||||
/// <param name="projectFolderItem"></param>
|
||||
public static void UpdateProjectFolderItem(Model.InformationProject_ProjectFolderItem projectFolderItem)
|
||||
{
|
||||
Model.InformationProject_ProjectFolderItem newProjectFolderItem = Funs.DB.InformationProject_ProjectFolderItem.FirstOrDefault(e => e.ProjectFolderItemId == projectFolderItem.ProjectFolderItemId);
|
||||
if (newProjectFolderItem != null)
|
||||
{
|
||||
newProjectFolderItem.Code = projectFolderItem.Code;
|
||||
newProjectFolderItem.Title = projectFolderItem.Title;
|
||||
newProjectFolderItem.FileContent = projectFolderItem.FileContent;
|
||||
newProjectFolderItem.CompileMan = projectFolderItem.CompileMan;
|
||||
newProjectFolderItem.CompileDate = projectFolderItem.CompileDate;
|
||||
newProjectFolderItem.AttachUrl = projectFolderItem.AttachUrl;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除信息
|
||||
/// </summary>
|
||||
/// <param name="projectFolderItemId"></param>
|
||||
public static void DeleteProjectFolderItemByID(string projectFolderItemId)
|
||||
{
|
||||
Model.InformationProject_ProjectFolderItem projectFolderItem = Funs.DB.InformationProject_ProjectFolderItem.FirstOrDefault(e => e.ProjectFolderItemId == projectFolderItemId);
|
||||
if (projectFolderItem != null)
|
||||
{
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(projectFolderItem.ProjectFolderItemId);
|
||||
////删除编码
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(projectFolderItem.ProjectFolderItemId);
|
||||
Funs.DB.InformationProject_ProjectFolderItem.DeleteOnSubmit(projectFolderItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目文件夹
|
||||
/// </summary>
|
||||
public static class ProjectFolderService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据用户id获取项目文夹主表列表
|
||||
/// </summary>
|
||||
/// <param name="appraise"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.InformationProject_ProjectFolder> GetProjectFolderListByProjectId(string projectId)
|
||||
{
|
||||
var ProjectFolderList = from x in Funs.DB.InformationProject_ProjectFolder where x.ProjectId == projectId select x;
|
||||
return ProjectFolderList.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键id获取项目文夹
|
||||
/// </summary>
|
||||
/// <param name="appraise"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_ProjectFolder GetProjectFolderByID(string projectFolderId)
|
||||
{
|
||||
return Funs.DB.InformationProject_ProjectFolder.FirstOrDefault(x => x.ProjectFolderId == projectFolderId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加项目文件夹
|
||||
/// </summary>
|
||||
/// <param name="projectFolder"></param>
|
||||
public static void AddProjectFolder(Model.InformationProject_ProjectFolder projectFolder)
|
||||
{
|
||||
Model.InformationProject_ProjectFolder newProjectFolder = new Model.InformationProject_ProjectFolder
|
||||
{
|
||||
ProjectFolderId = projectFolder.ProjectFolderId,
|
||||
ProjectId = projectFolder.ProjectId,
|
||||
Code = projectFolder.Code,
|
||||
Title = projectFolder.Title,
|
||||
SupProjectFolderId = projectFolder.SupProjectFolderId,
|
||||
IsEndLever = projectFolder.IsEndLever
|
||||
};
|
||||
Funs.DB.InformationProject_ProjectFolder.InsertOnSubmit(newProjectFolder);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改项目文件夹
|
||||
/// </summary>
|
||||
/// <param name="projectFolder"></param>
|
||||
public static void UpdateProjectFolder(Model.InformationProject_ProjectFolder projectFolder)
|
||||
{
|
||||
Model.InformationProject_ProjectFolder newProjectFolder = Funs.DB.InformationProject_ProjectFolder.FirstOrDefault(e => e.ProjectFolderId == projectFolder.ProjectFolderId);
|
||||
if (newProjectFolder != null)
|
||||
{
|
||||
newProjectFolder.Code = projectFolder.Code;
|
||||
newProjectFolder.Title = projectFolder.Title;
|
||||
newProjectFolder.IsEndLever = projectFolder.IsEndLever;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除信息
|
||||
/// </summary>
|
||||
/// <param name="projectFolderId"></param>
|
||||
public static void DeleteProjectFolderByID(string projectFolderId)
|
||||
{
|
||||
Model.InformationProject_ProjectFolder ProjectFolder = Funs.DB.InformationProject_ProjectFolder.FirstOrDefault(e => e.ProjectFolderId == projectFolderId);
|
||||
if (ProjectFolder != null)
|
||||
{
|
||||
Funs.DB.InformationProject_ProjectFolder.DeleteOnSubmit(ProjectFolder);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否存在文件夹名称
|
||||
/// </summary>
|
||||
/// <param name="postName"></param>
|
||||
/// <returns>true-存在,false-不存在</returns>
|
||||
public static bool IsExistTitle(string projectFolderId, string supProjectFolderId, string title)
|
||||
{
|
||||
var q = Funs.DB.InformationProject_ProjectFolder.FirstOrDefault(x => x.SupProjectFolderId == supProjectFolderId && x.Title == title
|
||||
&& x.ProjectFolderId != projectFolderId);
|
||||
if (q != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否可删除节点
|
||||
/// </summary>
|
||||
/// <param name="postName"></param>
|
||||
/// <returns>true-可以,false-不可以</returns>
|
||||
public static bool IsDeleteProjectFolder(string projectFolderId)
|
||||
{
|
||||
bool isDelete = true;
|
||||
var ProjectFolder = GetProjectFolderByID(projectFolderId);
|
||||
if (ProjectFolder != null)
|
||||
{
|
||||
if (ProjectFolder.IsEndLever == true)
|
||||
{
|
||||
var detailCout = Funs.DB.InformationProject_ProjectFolderItem.FirstOrDefault(x => x.ProjectFolderId == projectFolderId);
|
||||
if (detailCout != null)
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var supItemSetCount = Funs.DB.InformationProject_ProjectFolder.FirstOrDefault(x => x.SupProjectFolderId == projectFolderId);
|
||||
if (supItemSetCount != null)
|
||||
{
|
||||
isDelete = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return isDelete;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 百万工时安全统计月报
|
||||
/// </summary>
|
||||
public static class ProjectMillionsMonthlyReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取百万工时安全统计月报
|
||||
/// </summary>
|
||||
/// <param name="millionsMonthlyReport"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_MillionsMonthlyReport GetMillionsMonthlyReportById(string millionsMonthlyReportId)
|
||||
{
|
||||
return Funs.DB.InformationProject_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == millionsMonthlyReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加百万工时安全统计月报
|
||||
/// </summary>
|
||||
/// <param name="millionsMonthlyReport"></param>
|
||||
public static void AddMillionsMonthlyReport(Model.InformationProject_MillionsMonthlyReport millionsMonthlyReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_MillionsMonthlyReport newMillionsMonthlyReport = new Model.InformationProject_MillionsMonthlyReport
|
||||
{
|
||||
MillionsMonthlyReportId = millionsMonthlyReport.MillionsMonthlyReportId,
|
||||
ProjectId = millionsMonthlyReport.ProjectId,
|
||||
Year = millionsMonthlyReport.Year,
|
||||
Month = millionsMonthlyReport.Month,
|
||||
CompileMan = millionsMonthlyReport.CompileMan,
|
||||
CompileDate = millionsMonthlyReport.CompileDate,
|
||||
States = millionsMonthlyReport.States,
|
||||
Affiliation = millionsMonthlyReport.Affiliation,
|
||||
Name = millionsMonthlyReport.Name,
|
||||
PostPersonNum = millionsMonthlyReport.PostPersonNum,
|
||||
SnapPersonNum = millionsMonthlyReport.SnapPersonNum,
|
||||
ContractorNum = millionsMonthlyReport.ContractorNum,
|
||||
SumPersonNum = millionsMonthlyReport.SumPersonNum,
|
||||
TotalWorkNum = millionsMonthlyReport.TotalWorkNum,
|
||||
SeriousInjuriesNum = millionsMonthlyReport.SeriousInjuriesNum,
|
||||
SeriousInjuriesPersonNum = millionsMonthlyReport.SeriousInjuriesPersonNum,
|
||||
SeriousInjuriesLossHour = millionsMonthlyReport.SeriousInjuriesLossHour,
|
||||
MinorAccidentNum = millionsMonthlyReport.MinorAccidentNum,
|
||||
MinorAccidentPersonNum = millionsMonthlyReport.MinorAccidentPersonNum,
|
||||
MinorAccidentLossHour = millionsMonthlyReport.MinorAccidentLossHour,
|
||||
OtherAccidentNum = millionsMonthlyReport.OtherAccidentNum,
|
||||
OtherAccidentPersonNum = millionsMonthlyReport.OtherAccidentPersonNum,
|
||||
OtherAccidentLossHour = millionsMonthlyReport.OtherAccidentLossHour,
|
||||
RestrictedWorkPersonNum = millionsMonthlyReport.RestrictedWorkPersonNum,
|
||||
RestrictedWorkLossHour = millionsMonthlyReport.RestrictedWorkLossHour,
|
||||
MedicalTreatmentPersonNum = millionsMonthlyReport.MedicalTreatmentPersonNum,
|
||||
MedicalTreatmentLossHour = millionsMonthlyReport.MedicalTreatmentLossHour,
|
||||
FireNum = millionsMonthlyReport.FireNum,
|
||||
ExplosionNum = millionsMonthlyReport.ExplosionNum,
|
||||
TrafficNum = millionsMonthlyReport.TrafficNum,
|
||||
EquipmentNum = millionsMonthlyReport.EquipmentNum,
|
||||
QualityNum = millionsMonthlyReport.QualityNum,
|
||||
OtherNum = millionsMonthlyReport.OtherNum,
|
||||
FirstAidDressingsNum = millionsMonthlyReport.FirstAidDressingsNum,
|
||||
AttemptedEventNum = millionsMonthlyReport.AttemptedEventNum,
|
||||
LossDayNum = millionsMonthlyReport.LossDayNum
|
||||
};
|
||||
db.InformationProject_MillionsMonthlyReport.InsertOnSubmit(newMillionsMonthlyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改百万工时安全统计月报
|
||||
/// </summary>
|
||||
/// <param name="millionsMonthlyReport"></param>
|
||||
public static void UpdateMillionsMonthlyReport(Model.InformationProject_MillionsMonthlyReport millionsMonthlyReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_MillionsMonthlyReport newMillionsMonthlyReport = db.InformationProject_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == millionsMonthlyReport.MillionsMonthlyReportId);
|
||||
if (newMillionsMonthlyReport != null)
|
||||
{
|
||||
newMillionsMonthlyReport.ProjectId = millionsMonthlyReport.ProjectId;
|
||||
newMillionsMonthlyReport.Year = millionsMonthlyReport.Year;
|
||||
newMillionsMonthlyReport.Month = millionsMonthlyReport.Month;
|
||||
newMillionsMonthlyReport.CompileMan = millionsMonthlyReport.CompileMan;
|
||||
newMillionsMonthlyReport.CompileDate = millionsMonthlyReport.CompileDate;
|
||||
newMillionsMonthlyReport.States = millionsMonthlyReport.States;
|
||||
newMillionsMonthlyReport.Affiliation = millionsMonthlyReport.Affiliation;
|
||||
newMillionsMonthlyReport.Name = millionsMonthlyReport.Name;
|
||||
newMillionsMonthlyReport.PostPersonNum = millionsMonthlyReport.PostPersonNum;
|
||||
newMillionsMonthlyReport.SnapPersonNum = millionsMonthlyReport.SnapPersonNum;
|
||||
newMillionsMonthlyReport.ContractorNum = millionsMonthlyReport.ContractorNum;
|
||||
newMillionsMonthlyReport.SumPersonNum = millionsMonthlyReport.SumPersonNum;
|
||||
newMillionsMonthlyReport.TotalWorkNum = millionsMonthlyReport.TotalWorkNum;
|
||||
newMillionsMonthlyReport.SeriousInjuriesNum = millionsMonthlyReport.SeriousInjuriesNum;
|
||||
newMillionsMonthlyReport.SeriousInjuriesPersonNum = millionsMonthlyReport.SeriousInjuriesPersonNum;
|
||||
newMillionsMonthlyReport.SeriousInjuriesLossHour = millionsMonthlyReport.SeriousInjuriesLossHour;
|
||||
newMillionsMonthlyReport.MinorAccidentNum = millionsMonthlyReport.MinorAccidentNum;
|
||||
newMillionsMonthlyReport.MinorAccidentPersonNum = millionsMonthlyReport.MinorAccidentPersonNum;
|
||||
newMillionsMonthlyReport.MinorAccidentLossHour = millionsMonthlyReport.MinorAccidentLossHour;
|
||||
newMillionsMonthlyReport.OtherAccidentNum = millionsMonthlyReport.OtherAccidentNum;
|
||||
newMillionsMonthlyReport.OtherAccidentPersonNum = millionsMonthlyReport.OtherAccidentPersonNum;
|
||||
newMillionsMonthlyReport.OtherAccidentLossHour = millionsMonthlyReport.OtherAccidentLossHour;
|
||||
newMillionsMonthlyReport.RestrictedWorkPersonNum = millionsMonthlyReport.RestrictedWorkPersonNum;
|
||||
newMillionsMonthlyReport.RestrictedWorkLossHour = millionsMonthlyReport.RestrictedWorkLossHour;
|
||||
newMillionsMonthlyReport.MedicalTreatmentPersonNum = millionsMonthlyReport.MedicalTreatmentPersonNum;
|
||||
newMillionsMonthlyReport.MedicalTreatmentLossHour = millionsMonthlyReport.MedicalTreatmentLossHour;
|
||||
newMillionsMonthlyReport.FireNum = millionsMonthlyReport.FireNum;
|
||||
newMillionsMonthlyReport.ExplosionNum = millionsMonthlyReport.ExplosionNum;
|
||||
newMillionsMonthlyReport.TrafficNum = millionsMonthlyReport.TrafficNum;
|
||||
newMillionsMonthlyReport.EquipmentNum = millionsMonthlyReport.EquipmentNum;
|
||||
newMillionsMonthlyReport.QualityNum = millionsMonthlyReport.QualityNum;
|
||||
newMillionsMonthlyReport.OtherNum = millionsMonthlyReport.OtherNum;
|
||||
newMillionsMonthlyReport.FirstAidDressingsNum = millionsMonthlyReport.FirstAidDressingsNum;
|
||||
newMillionsMonthlyReport.AttemptedEventNum = millionsMonthlyReport.AttemptedEventNum;
|
||||
newMillionsMonthlyReport.LossDayNum = millionsMonthlyReport.LossDayNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除百万工时安全统计月报
|
||||
/// </summary>
|
||||
/// <param name="millionsMonthlyReportId"></param>
|
||||
public static void DeleteMillionsMonthlyReportById(string millionsMonthlyReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_MillionsMonthlyReport millionsMonthlyReport = db.InformationProject_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == millionsMonthlyReportId);
|
||||
if (millionsMonthlyReport != null)
|
||||
{
|
||||
CommonService.DeleteFlowOperateByID(millionsMonthlyReportId);//删除流程
|
||||
db.InformationProject_MillionsMonthlyReport.DeleteOnSubmit(millionsMonthlyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全生产数据季报
|
||||
/// </summary>
|
||||
public static class ProjectSafetyQuarterlyReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="safetyQuarterlyReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_SafetyQuarterlyReport GetSafetyQuarterlyReportById(string safetyQuarterlyReportId)
|
||||
{
|
||||
return Funs.DB.InformationProject_SafetyQuarterlyReport.FirstOrDefault(e => e.SafetyQuarterlyReportId == safetyQuarterlyReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="safetyQuarterlyReport"></param>
|
||||
public static void AddSafetyQuarterlyReport(Model.InformationProject_SafetyQuarterlyReport safetyQuarterlyReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_SafetyQuarterlyReport newSafetyQuarterlyReport = new Model.InformationProject_SafetyQuarterlyReport
|
||||
{
|
||||
SafetyQuarterlyReportId = safetyQuarterlyReport.SafetyQuarterlyReportId,
|
||||
ProjectId = safetyQuarterlyReport.ProjectId,
|
||||
UnitId = safetyQuarterlyReport.UnitId,
|
||||
YearId = safetyQuarterlyReport.YearId,
|
||||
Quarters = safetyQuarterlyReport.Quarters,
|
||||
TotalInWorkHours = safetyQuarterlyReport.TotalInWorkHours,
|
||||
TotalInWorkHoursRemark = safetyQuarterlyReport.TotalInWorkHoursRemark,
|
||||
TotalOutWorkHours = safetyQuarterlyReport.TotalOutWorkHours,
|
||||
TotalOutWorkHoursRemark = safetyQuarterlyReport.TotalOutWorkHoursRemark,
|
||||
WorkHoursLossRate = safetyQuarterlyReport.WorkHoursLossRate,
|
||||
WorkHoursLossRateRemark = safetyQuarterlyReport.WorkHoursLossRateRemark,
|
||||
WorkHoursAccuracy = safetyQuarterlyReport.WorkHoursAccuracy,
|
||||
WorkHoursAccuracyRemark = safetyQuarterlyReport.WorkHoursAccuracyRemark,
|
||||
MainBusinessIncome = safetyQuarterlyReport.MainBusinessIncome,
|
||||
MainBusinessIncomeRemark = safetyQuarterlyReport.MainBusinessIncomeRemark,
|
||||
ConstructionRevenue = safetyQuarterlyReport.ConstructionRevenue,
|
||||
ConstructionRevenueRemark = safetyQuarterlyReport.ConstructionRevenueRemark,
|
||||
UnitTimeIncome = safetyQuarterlyReport.UnitTimeIncome,
|
||||
UnitTimeIncomeRemark = safetyQuarterlyReport.UnitTimeIncomeRemark,
|
||||
BillionsOutputMortality = safetyQuarterlyReport.BillionsOutputMortality,
|
||||
BillionsOutputMortalityRemark = safetyQuarterlyReport.BillionsOutputMortalityRemark,
|
||||
MajorFireAccident = safetyQuarterlyReport.MajorFireAccident,
|
||||
MajorFireAccidentRemark = safetyQuarterlyReport.MajorFireAccidentRemark,
|
||||
MajorEquipAccident = safetyQuarterlyReport.MajorEquipAccident,
|
||||
MajorEquipAccidentRemark = safetyQuarterlyReport.MajorEquipAccidentRemark,
|
||||
AccidentFrequency = safetyQuarterlyReport.AccidentFrequency,
|
||||
AccidentFrequencyRemark = safetyQuarterlyReport.AccidentFrequencyRemark,
|
||||
SeriousInjuryAccident = safetyQuarterlyReport.SeriousInjuryAccident,
|
||||
SeriousInjuryAccidentRemark = safetyQuarterlyReport.SeriousInjuryAccidentRemark,
|
||||
FireAccident = safetyQuarterlyReport.FireAccident,
|
||||
FireAccidentRemark = safetyQuarterlyReport.FireAccidentRemark,
|
||||
EquipmentAccident = safetyQuarterlyReport.EquipmentAccident,
|
||||
EquipmentAccidentRemark = safetyQuarterlyReport.EquipmentAccidentRemark,
|
||||
PoisoningAndInjuries = safetyQuarterlyReport.PoisoningAndInjuries,
|
||||
PoisoningAndInjuriesRemark = safetyQuarterlyReport.PoisoningAndInjuriesRemark,
|
||||
ProductionSafetyInTotal = safetyQuarterlyReport.ProductionSafetyInTotal,
|
||||
ProductionSafetyInTotalRemark = safetyQuarterlyReport.ProductionSafetyInTotalRemark,
|
||||
ProtectionInput = safetyQuarterlyReport.ProtectionInput,
|
||||
ProtectionInputRemark = safetyQuarterlyReport.ProtectionInputRemark,
|
||||
LaboAndHealthIn = safetyQuarterlyReport.LaboAndHealthIn,
|
||||
LaborAndHealthInRemark = safetyQuarterlyReport.LaborAndHealthInRemark,
|
||||
TechnologyProgressIn = safetyQuarterlyReport.TechnologyProgressIn,
|
||||
TechnologyProgressInRemark = safetyQuarterlyReport.TechnologyProgressInRemark,
|
||||
EducationTrainIn = safetyQuarterlyReport.EducationTrainIn,
|
||||
EducationTrainInRemark = safetyQuarterlyReport.EducationTrainInRemark,
|
||||
ProjectCostRate = safetyQuarterlyReport.ProjectCostRate,
|
||||
ProjectCostRateRemark = safetyQuarterlyReport.ProjectCostRateRemark,
|
||||
ProductionInput = safetyQuarterlyReport.ProductionInput,
|
||||
ProductionInputRemark = safetyQuarterlyReport.ProductionInputRemark,
|
||||
Revenue = safetyQuarterlyReport.Revenue,
|
||||
RevenueRemark = safetyQuarterlyReport.RevenueRemark,
|
||||
FullTimeMan = safetyQuarterlyReport.FullTimeMan,
|
||||
FullTimeManRemark = safetyQuarterlyReport.FullTimeManRemark,
|
||||
FullTimeManAttachUrl = safetyQuarterlyReport.FullTimeManAttachUrl,
|
||||
PMMan = safetyQuarterlyReport.PMMan,
|
||||
PMManRemark = safetyQuarterlyReport.PMManRemark,
|
||||
PMManAttachUrl = safetyQuarterlyReport.PMManAttachUrl,
|
||||
CorporateDirectorEdu = safetyQuarterlyReport.CorporateDirectorEdu,
|
||||
CorporateDirectorEduRemark = safetyQuarterlyReport.CorporateDirectorEduRemark,
|
||||
ProjectLeaderEdu = safetyQuarterlyReport.ProjectLeaderEdu,
|
||||
ProjectLeaderEduRemark = safetyQuarterlyReport.ProjectLeaderEduRemark,
|
||||
FullTimeEdu = safetyQuarterlyReport.FullTimeEdu,
|
||||
FullTimeEduRemark = safetyQuarterlyReport.FullTimeEduRemark,
|
||||
ThreeKidsEduRate = safetyQuarterlyReport.ThreeKidsEduRate,
|
||||
ThreeKidsEduRateRemark = safetyQuarterlyReport.ThreeKidsEduRateRemark,
|
||||
UplinReportRate = safetyQuarterlyReport.UplinReportRate,
|
||||
UplinReportRateRemark = safetyQuarterlyReport.UplinReportRateRemark,
|
||||
Remarks = safetyQuarterlyReport.Remarks,
|
||||
KeyEquipmentTotal = safetyQuarterlyReport.KeyEquipmentTotal,
|
||||
KeyEquipmentTotalRemark = safetyQuarterlyReport.KeyEquipmentTotalRemark,
|
||||
KeyEquipmentReportCount = safetyQuarterlyReport.KeyEquipmentReportCount,
|
||||
KeyEquipmentReportCountRemark = safetyQuarterlyReport.KeyEquipmentReportCountRemark,
|
||||
ChemicalAreaProjectCount = safetyQuarterlyReport.ChemicalAreaProjectCount,
|
||||
ChemicalAreaProjectCountRemark = safetyQuarterlyReport.ChemicalAreaProjectCountRemark,
|
||||
HarmfulMediumCoverCount = safetyQuarterlyReport.HarmfulMediumCoverCount,
|
||||
HarmfulMediumCoverCountRemark = safetyQuarterlyReport.HarmfulMediumCoverCountRemark,
|
||||
HarmfulMediumCoverRate = safetyQuarterlyReport.HarmfulMediumCoverRate,
|
||||
HarmfulMediumCoverRateRemark = safetyQuarterlyReport.HarmfulMediumCoverRateRemark,
|
||||
CompileMan = safetyQuarterlyReport.CompileMan,
|
||||
CompileDate = safetyQuarterlyReport.CompileDate,
|
||||
States = safetyQuarterlyReport.States
|
||||
};
|
||||
|
||||
db.InformationProject_SafetyQuarterlyReport.InsertOnSubmit(newSafetyQuarterlyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="safetyQuarterlyReport"></param>
|
||||
public static void UpdateSafetyQuarterlyReport(Model.InformationProject_SafetyQuarterlyReport safetyQuarterlyReport)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_SafetyQuarterlyReport newSafetyQuarterlyReport = db.InformationProject_SafetyQuarterlyReport.FirstOrDefault(e => e.SafetyQuarterlyReportId == safetyQuarterlyReport.SafetyQuarterlyReportId);
|
||||
if (newSafetyQuarterlyReport != null)
|
||||
{
|
||||
newSafetyQuarterlyReport.ProjectId = safetyQuarterlyReport.ProjectId;
|
||||
newSafetyQuarterlyReport.UnitId = safetyQuarterlyReport.UnitId;
|
||||
newSafetyQuarterlyReport.YearId = safetyQuarterlyReport.YearId;
|
||||
newSafetyQuarterlyReport.Quarters = safetyQuarterlyReport.Quarters;
|
||||
newSafetyQuarterlyReport.TotalInWorkHours = safetyQuarterlyReport.TotalInWorkHours;
|
||||
newSafetyQuarterlyReport.TotalInWorkHoursRemark = safetyQuarterlyReport.TotalInWorkHoursRemark;
|
||||
newSafetyQuarterlyReport.TotalOutWorkHours = safetyQuarterlyReport.TotalOutWorkHours;
|
||||
newSafetyQuarterlyReport.TotalOutWorkHoursRemark = safetyQuarterlyReport.TotalOutWorkHoursRemark;
|
||||
newSafetyQuarterlyReport.WorkHoursLossRate = safetyQuarterlyReport.WorkHoursLossRate;
|
||||
newSafetyQuarterlyReport.WorkHoursLossRateRemark = safetyQuarterlyReport.WorkHoursLossRateRemark;
|
||||
newSafetyQuarterlyReport.WorkHoursAccuracy = safetyQuarterlyReport.WorkHoursAccuracy;
|
||||
newSafetyQuarterlyReport.WorkHoursAccuracyRemark = safetyQuarterlyReport.WorkHoursAccuracyRemark;
|
||||
newSafetyQuarterlyReport.MainBusinessIncome = safetyQuarterlyReport.MainBusinessIncome;
|
||||
newSafetyQuarterlyReport.MainBusinessIncomeRemark = safetyQuarterlyReport.MainBusinessIncomeRemark;
|
||||
newSafetyQuarterlyReport.ConstructionRevenue = safetyQuarterlyReport.ConstructionRevenue;
|
||||
newSafetyQuarterlyReport.ConstructionRevenueRemark = safetyQuarterlyReport.ConstructionRevenueRemark;
|
||||
newSafetyQuarterlyReport.UnitTimeIncome = safetyQuarterlyReport.UnitTimeIncome;
|
||||
newSafetyQuarterlyReport.UnitTimeIncomeRemark = safetyQuarterlyReport.UnitTimeIncomeRemark;
|
||||
newSafetyQuarterlyReport.BillionsOutputMortality = safetyQuarterlyReport.BillionsOutputMortality;
|
||||
newSafetyQuarterlyReport.BillionsOutputMortalityRemark = safetyQuarterlyReport.BillionsOutputMortalityRemark;
|
||||
newSafetyQuarterlyReport.MajorFireAccident = safetyQuarterlyReport.MajorFireAccident;
|
||||
newSafetyQuarterlyReport.MajorFireAccidentRemark = safetyQuarterlyReport.MajorFireAccidentRemark;
|
||||
newSafetyQuarterlyReport.MajorEquipAccident = safetyQuarterlyReport.MajorEquipAccident;
|
||||
newSafetyQuarterlyReport.MajorEquipAccidentRemark = safetyQuarterlyReport.MajorEquipAccidentRemark;
|
||||
newSafetyQuarterlyReport.AccidentFrequency = safetyQuarterlyReport.AccidentFrequency;
|
||||
newSafetyQuarterlyReport.AccidentFrequencyRemark = safetyQuarterlyReport.AccidentFrequencyRemark;
|
||||
newSafetyQuarterlyReport.SeriousInjuryAccident = safetyQuarterlyReport.SeriousInjuryAccident;
|
||||
newSafetyQuarterlyReport.SeriousInjuryAccidentRemark = safetyQuarterlyReport.SeriousInjuryAccidentRemark;
|
||||
newSafetyQuarterlyReport.FireAccident = safetyQuarterlyReport.FireAccident;
|
||||
newSafetyQuarterlyReport.FireAccidentRemark = safetyQuarterlyReport.FireAccidentRemark;
|
||||
newSafetyQuarterlyReport.EquipmentAccident = safetyQuarterlyReport.EquipmentAccident;
|
||||
newSafetyQuarterlyReport.EquipmentAccidentRemark = safetyQuarterlyReport.EquipmentAccidentRemark;
|
||||
newSafetyQuarterlyReport.PoisoningAndInjuries = safetyQuarterlyReport.PoisoningAndInjuries;
|
||||
newSafetyQuarterlyReport.PoisoningAndInjuriesRemark = safetyQuarterlyReport.PoisoningAndInjuriesRemark;
|
||||
newSafetyQuarterlyReport.ProductionSafetyInTotal = safetyQuarterlyReport.ProductionSafetyInTotal;
|
||||
newSafetyQuarterlyReport.ProductionSafetyInTotalRemark = safetyQuarterlyReport.ProductionSafetyInTotalRemark;
|
||||
newSafetyQuarterlyReport.ProtectionInput = safetyQuarterlyReport.ProtectionInput;
|
||||
newSafetyQuarterlyReport.ProtectionInputRemark = safetyQuarterlyReport.ProtectionInputRemark;
|
||||
newSafetyQuarterlyReport.LaboAndHealthIn = safetyQuarterlyReport.LaboAndHealthIn;
|
||||
newSafetyQuarterlyReport.LaborAndHealthInRemark = safetyQuarterlyReport.LaborAndHealthInRemark;
|
||||
newSafetyQuarterlyReport.TechnologyProgressIn = safetyQuarterlyReport.TechnologyProgressIn;
|
||||
newSafetyQuarterlyReport.TechnologyProgressInRemark = safetyQuarterlyReport.TechnologyProgressInRemark;
|
||||
newSafetyQuarterlyReport.EducationTrainIn = safetyQuarterlyReport.EducationTrainIn;
|
||||
newSafetyQuarterlyReport.EducationTrainInRemark = safetyQuarterlyReport.EducationTrainInRemark;
|
||||
newSafetyQuarterlyReport.ProjectCostRate = safetyQuarterlyReport.ProjectCostRate;
|
||||
newSafetyQuarterlyReport.ProjectCostRateRemark = safetyQuarterlyReport.ProjectCostRateRemark;
|
||||
newSafetyQuarterlyReport.ProductionInput = safetyQuarterlyReport.ProductionInput;
|
||||
newSafetyQuarterlyReport.ProductionInputRemark = safetyQuarterlyReport.ProductionInputRemark;
|
||||
newSafetyQuarterlyReport.Revenue = safetyQuarterlyReport.Revenue;
|
||||
newSafetyQuarterlyReport.RevenueRemark = safetyQuarterlyReport.RevenueRemark;
|
||||
newSafetyQuarterlyReport.FullTimeMan = safetyQuarterlyReport.FullTimeMan;
|
||||
newSafetyQuarterlyReport.FullTimeManRemark = safetyQuarterlyReport.FullTimeManRemark;
|
||||
newSafetyQuarterlyReport.FullTimeManAttachUrl = safetyQuarterlyReport.FullTimeManAttachUrl;
|
||||
newSafetyQuarterlyReport.PMMan = safetyQuarterlyReport.PMMan;
|
||||
newSafetyQuarterlyReport.PMManRemark = safetyQuarterlyReport.PMManRemark;
|
||||
newSafetyQuarterlyReport.PMManAttachUrl = safetyQuarterlyReport.PMManAttachUrl;
|
||||
newSafetyQuarterlyReport.CorporateDirectorEdu = safetyQuarterlyReport.CorporateDirectorEdu;
|
||||
newSafetyQuarterlyReport.CorporateDirectorEduRemark = safetyQuarterlyReport.CorporateDirectorEduRemark;
|
||||
newSafetyQuarterlyReport.ProjectLeaderEdu = safetyQuarterlyReport.ProjectLeaderEdu;
|
||||
newSafetyQuarterlyReport.ProjectLeaderEduRemark = safetyQuarterlyReport.ProjectLeaderEduRemark;
|
||||
newSafetyQuarterlyReport.FullTimeEdu = safetyQuarterlyReport.FullTimeEdu;
|
||||
newSafetyQuarterlyReport.FullTimeEduRemark = safetyQuarterlyReport.FullTimeEduRemark;
|
||||
newSafetyQuarterlyReport.ThreeKidsEduRate = safetyQuarterlyReport.ThreeKidsEduRate;
|
||||
newSafetyQuarterlyReport.ThreeKidsEduRateRemark = safetyQuarterlyReport.ThreeKidsEduRateRemark;
|
||||
newSafetyQuarterlyReport.UplinReportRate = safetyQuarterlyReport.UplinReportRate;
|
||||
newSafetyQuarterlyReport.UplinReportRateRemark = safetyQuarterlyReport.UplinReportRateRemark;
|
||||
newSafetyQuarterlyReport.Remarks = safetyQuarterlyReport.Remarks;
|
||||
newSafetyQuarterlyReport.KeyEquipmentTotal = safetyQuarterlyReport.KeyEquipmentTotal;
|
||||
newSafetyQuarterlyReport.KeyEquipmentTotalRemark = safetyQuarterlyReport.KeyEquipmentTotalRemark;
|
||||
newSafetyQuarterlyReport.KeyEquipmentReportCount = safetyQuarterlyReport.KeyEquipmentReportCount;
|
||||
newSafetyQuarterlyReport.KeyEquipmentReportCountRemark = safetyQuarterlyReport.KeyEquipmentReportCountRemark;
|
||||
newSafetyQuarterlyReport.ChemicalAreaProjectCount = safetyQuarterlyReport.ChemicalAreaProjectCount;
|
||||
newSafetyQuarterlyReport.ChemicalAreaProjectCountRemark = safetyQuarterlyReport.ChemicalAreaProjectCountRemark;
|
||||
newSafetyQuarterlyReport.HarmfulMediumCoverCount = safetyQuarterlyReport.HarmfulMediumCoverCount;
|
||||
newSafetyQuarterlyReport.HarmfulMediumCoverCountRemark = safetyQuarterlyReport.HarmfulMediumCoverCountRemark;
|
||||
newSafetyQuarterlyReport.HarmfulMediumCoverRate = safetyQuarterlyReport.HarmfulMediumCoverRate;
|
||||
newSafetyQuarterlyReport.HarmfulMediumCoverRateRemark = safetyQuarterlyReport.HarmfulMediumCoverRateRemark;
|
||||
newSafetyQuarterlyReport.CompileMan = safetyQuarterlyReport.CompileMan;
|
||||
newSafetyQuarterlyReport.CompileDate = safetyQuarterlyReport.CompileDate;
|
||||
newSafetyQuarterlyReport.States = safetyQuarterlyReport.States;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="safetyQuarterlyReportId"></param>
|
||||
public static void DeleteSafetyQuarterlyReportById(string safetyQuarterlyReportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InformationProject_SafetyQuarterlyReport safetyQuarterlyReport = db.InformationProject_SafetyQuarterlyReport.FirstOrDefault(e => e.SafetyQuarterlyReportId == safetyQuarterlyReportId);
|
||||
if (safetyQuarterlyReport != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(safetyQuarterlyReport.FullTimeManAttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, safetyQuarterlyReport.FullTimeManAttachUrl);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(safetyQuarterlyReport.PMManAttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, safetyQuarterlyReport.PMManAttachUrl);
|
||||
}
|
||||
CommonService.DeleteFlowOperateByID(safetyQuarterlyReportId);
|
||||
db.InformationProject_SafetyQuarterlyReport.DeleteOnSubmit(safetyQuarterlyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// HSE宣传活动
|
||||
/// </summary>
|
||||
public static class PromotionalActivitiesService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取HSSE宣传活动
|
||||
/// </summary>
|
||||
/// <param name="promotionalActivitiesId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_PromotionalActivities GetPromotionalActivitiesById(string promotionalActivitiesId)
|
||||
{
|
||||
return Funs.DB.InformationProject_PromotionalActivities.FirstOrDefault(e => e.PromotionalActivitiesId == promotionalActivitiesId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据时间段获取HSE宣传活动
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目Id</param>
|
||||
/// <returns>时间段内的HSE宣传活动数量</returns>
|
||||
public static int GetCountByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.InformationProject_PromotionalActivities where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId select x).Count();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取HSE宣传活动集合
|
||||
/// </summary>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <param name="projectId">项目号</param>
|
||||
/// <returns>HSE宣传活动集合</returns>
|
||||
public static List<Model.InformationProject_PromotionalActivities> GetPromotionalActivitiesListsByDate(DateTime startTime, DateTime endTime, string projectId)
|
||||
{
|
||||
return (from x in Funs.DB.InformationProject_PromotionalActivities where x.CompileDate >= startTime && x.CompileDate <= endTime && x.ProjectId == projectId orderby x.CompileDate select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加HSSE宣传活动
|
||||
/// </summary>
|
||||
/// <param name="promotionalActivities"></param>
|
||||
public static void AddPromotionalActivities(Model.InformationProject_PromotionalActivities promotionalActivities)
|
||||
{
|
||||
Model.InformationProject_PromotionalActivities newPromotionalActivities = new Model.InformationProject_PromotionalActivities
|
||||
{
|
||||
PromotionalActivitiesId = promotionalActivities.PromotionalActivitiesId,
|
||||
ProjectId = promotionalActivities.ProjectId,
|
||||
Code = promotionalActivities.Code,
|
||||
Title = promotionalActivities.Title,
|
||||
ActivitiesDate = promotionalActivities.ActivitiesDate,
|
||||
UnitIds = promotionalActivities.UnitIds,
|
||||
UnitNames = promotionalActivities.UnitNames,
|
||||
UserIds = promotionalActivities.UserIds,
|
||||
UserNames = promotionalActivities.UserNames,
|
||||
MainContent = promotionalActivities.MainContent,
|
||||
AttachUrl = promotionalActivities.AttachUrl,
|
||||
CompileMan = promotionalActivities.CompileMan,
|
||||
CompileDate = System.DateTime.Now,
|
||||
States = promotionalActivities.States
|
||||
};
|
||||
Funs.DB.InformationProject_PromotionalActivities.InsertOnSubmit(newPromotionalActivities);
|
||||
Funs.DB.SubmitChanges();
|
||||
////增加一条编码记录
|
||||
BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectPromotionalActivitiesMenuId, promotionalActivities.ProjectId, null, promotionalActivities.PromotionalActivitiesId, promotionalActivities.ActivitiesDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改HSSE宣传活动
|
||||
/// </summary>
|
||||
/// <param name="PromotionalActivities"></param>
|
||||
public static void UpdatePromotionalActivities(Model.InformationProject_PromotionalActivities promotionalActivities)
|
||||
{
|
||||
Model.InformationProject_PromotionalActivities newPromotionalActivities = Funs.DB.InformationProject_PromotionalActivities.FirstOrDefault(e => e.PromotionalActivitiesId == promotionalActivities.PromotionalActivitiesId);
|
||||
if (newPromotionalActivities != null)
|
||||
{
|
||||
newPromotionalActivities.Code = promotionalActivities.Code;
|
||||
newPromotionalActivities.Title = promotionalActivities.Title;
|
||||
newPromotionalActivities.ActivitiesDate = promotionalActivities.ActivitiesDate;
|
||||
newPromotionalActivities.UnitIds = promotionalActivities.UnitIds;
|
||||
newPromotionalActivities.UnitNames = promotionalActivities.UnitNames;
|
||||
newPromotionalActivities.UserIds = promotionalActivities.UserIds;
|
||||
newPromotionalActivities.UserNames = promotionalActivities.UserNames;
|
||||
newPromotionalActivities.MainContent = promotionalActivities.MainContent;
|
||||
newPromotionalActivities.AttachUrl = promotionalActivities.AttachUrl;
|
||||
newPromotionalActivities.CompileMan = promotionalActivities.CompileMan;
|
||||
newPromotionalActivities.CompileDate = promotionalActivities.CompileDate;
|
||||
newPromotionalActivities.States = promotionalActivities.States;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除HSSE宣传活动
|
||||
/// </summary>
|
||||
/// <param name="promotionalActivitiesId"></param>
|
||||
public static void DeletePromotionalActivitiesById(string promotionalActivitiesId)
|
||||
{
|
||||
Model.InformationProject_PromotionalActivities promotionalActivities = Funs.DB.InformationProject_PromotionalActivities.FirstOrDefault(e => e.PromotionalActivitiesId == promotionalActivitiesId);
|
||||
if (promotionalActivities != null)
|
||||
{
|
||||
///删除编码表记录
|
||||
BLL.CodeRecordsService.DeleteCodeRecordsByDataId(promotionalActivities.PromotionalActivitiesId);
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(promotionalActivities.PromotionalActivitiesId);
|
||||
///删除工程师日志收集记录
|
||||
var flowOperate = from x in Funs.DB.Sys_FlowOperate where x.DataId == promotionalActivities.PromotionalActivitiesId select x;
|
||||
if (flowOperate.Count() > 0)
|
||||
{
|
||||
foreach (var item in flowOperate)
|
||||
{
|
||||
BLL.HSSELogService.CollectHSSELog(promotionalActivities.ProjectId, item.OperaterId, item.OperaterTime, "29", promotionalActivities.Title, Const.BtnDelete, 1);
|
||||
}
|
||||
////删除流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(promotionalActivities.PromotionalActivitiesId);
|
||||
}
|
||||
Funs.DB.InformationProject_PromotionalActivities.DeleteOnSubmit(promotionalActivities);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user