Example #1
0
 /// <summary>
 /// 根据主键删除应急演练
 /// </summary>
 /// <param name="DrillRecordListId"></param>
 public static void DeleteDrillRecordListById(string DrillRecordListId)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Emergency_DrillRecordList DrillRecordList = db.Emergency_DrillRecordList.FirstOrDefault(e => e.DrillRecordListId == DrillRecordListId);
     if (DrillRecordList != null)
     {
         ///删除编码表记录
         BLL.CodeRecordsService.DeleteCodeRecordsByDataId(DrillRecordList.DrillRecordListId);
         ////删除附件表
         BLL.CommonService.DeleteAttachFileById(DrillRecordList.DrillRecordListId);
         ///删除工程师日志收集记录
         var flowOperate = from x in db.Sys_FlowOperate where x.DataId == DrillRecordList.DrillRecordListId select x;
         if (flowOperate.Count() > 0)
         {
             foreach (var item in flowOperate)
             {
                 BLL.HSSELogService.CollectHSSELog(DrillRecordList.ProjectId, item.OperaterId, item.OperaterTime, "26", "应急演练:" + DrillRecordList.DrillRecordName, Const.BtnDelete, 1);
             }
             ////删除流程表
             BLL.CommonService.DeleteFlowOperateByID(DrillRecordList.DrillRecordListId);
         }
         db.Emergency_DrillRecordList.DeleteOnSubmit(DrillRecordList);
         db.SubmitChanges();
     }
 }
Example #2
0
 /// <summary>
 /// 添加应急演练
 /// </summary>
 /// <param name="DrillRecordList"></param>
 public static void AddDrillRecordList(Model.Emergency_DrillRecordList DrillRecordList)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Emergency_DrillRecordList newDrillRecordList = new Model.Emergency_DrillRecordList
     {
         DrillRecordListId   = DrillRecordList.DrillRecordListId,
         ProjectId           = DrillRecordList.ProjectId,
         DrillRecordCode     = DrillRecordList.DrillRecordCode,
         DrillRecordName     = DrillRecordList.DrillRecordName,
         UnitIds             = DrillRecordList.UnitIds,
         UnitNames           = DrillRecordList.UnitNames,
         UserIds             = DrillRecordList.UserIds,
         UserNames           = DrillRecordList.UserNames,
         DrillRecordDate     = DrillRecordList.DrillRecordDate,
         DrillRecordContents = DrillRecordList.DrillRecordContents,
         CompileMan          = DrillRecordList.CompileMan,
         CompileDate         = System.DateTime.Now,
         States          = DrillRecordList.States,
         AttachUrl       = DrillRecordList.AttachUrl,
         DrillRecordType = DrillRecordList.DrillRecordType,
         JointPersonNum  = DrillRecordList.JointPersonNum,
         DrillCost       = DrillRecordList.DrillCost
     };
     db.Emergency_DrillRecordList.InsertOnSubmit(newDrillRecordList);
     db.SubmitChanges();
     ////增加一条编码记录
     BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectDrillRecordListMenuId, DrillRecordList.ProjectId, null, DrillRecordList.DrillRecordListId, DrillRecordList.DrillRecordDate);
 }
Example #3
0
 /// <summary>
 /// 修改应急演练
 /// </summary>
 /// <param name="DrillRecordList"></param>
 public static void UpdateDrillRecordList(Model.Emergency_DrillRecordList DrillRecordList)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Emergency_DrillRecordList newDrillRecordList = db.Emergency_DrillRecordList.FirstOrDefault(e => e.DrillRecordListId == DrillRecordList.DrillRecordListId);
     if (newDrillRecordList != null)
     {
         newDrillRecordList.DrillRecordCode     = DrillRecordList.DrillRecordCode;
         newDrillRecordList.DrillRecordName     = DrillRecordList.DrillRecordName;
         newDrillRecordList.UnitIds             = DrillRecordList.UnitIds;
         newDrillRecordList.UnitNames           = DrillRecordList.UnitNames;
         newDrillRecordList.UserIds             = DrillRecordList.UserIds;
         newDrillRecordList.UserNames           = DrillRecordList.UserNames;
         newDrillRecordList.DrillRecordDate     = DrillRecordList.DrillRecordDate;
         newDrillRecordList.DrillRecordContents = DrillRecordList.DrillRecordContents;
         newDrillRecordList.CompileMan          = DrillRecordList.CompileMan;
         //newDrillRecordList.CompileDate = DrillRecordList.CompileDate;
         newDrillRecordList.States          = DrillRecordList.States;
         newDrillRecordList.AttachUrl       = DrillRecordList.AttachUrl;
         newDrillRecordList.DrillRecordType = DrillRecordList.DrillRecordType;
         newDrillRecordList.JointPersonNum  = DrillRecordList.JointPersonNum;
         newDrillRecordList.DrillCost       = DrillRecordList.DrillCost;
         db.SubmitChanges();
     }
 }