Ejemplo n.º 1
0
 /// <summary>
 /// 修改安全其他危险源辨识文件
 /// </summary>
 /// <param name="registration"></param>
 public static void UpdateOtherHazard(Model.Hazard_OtherHazard registration)
 {
     Model.SUBHSSEDB          db             = Funs.DB;
     Model.Hazard_OtherHazard newOtherHazard = db.Hazard_OtherHazard.FirstOrDefault(e => e.OtherHazardId == registration.OtherHazardId);
     if (newOtherHazard != null)
     {
         newOtherHazard.OtherHazardCode = registration.OtherHazardCode;
         newOtherHazard.OtherHazardName = registration.OtherHazardName;
         newOtherHazard.AttachUrl       = registration.AttachUrl;
         newOtherHazard.CompileDate     = registration.CompileDate;
         newOtherHazard.States          = registration.States;
         db.SubmitChanges();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加安全其他危险源辨识文件
        /// </summary>
        /// <param name="registration"></param>
        public static void AddOtherHazard(Model.Hazard_OtherHazard registration)
        {
            Model.SUBHSSEDB          db             = Funs.DB;
            Model.Hazard_OtherHazard newOtherHazard = new Model.Hazard_OtherHazard
            {
                OtherHazardId   = registration.OtherHazardId,
                ProjectId       = registration.ProjectId,
                OtherHazardCode = registration.OtherHazardCode,
                OtherHazardName = registration.OtherHazardName,
                AttachUrl       = registration.AttachUrl,
                CompileMan      = registration.CompileMan,
                CompileDate     = registration.CompileDate,
                States          = registration.States
            };

            db.Hazard_OtherHazard.InsertOnSubmit(newOtherHazard);
            db.SubmitChanges();
            ////增加一条编码记录
            BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.OtherHazardMenuId, registration.ProjectId, null, registration.OtherHazardId, registration.CompileDate);
        }