Ejemplo n.º 1
0
 /// <summary>
 /// 新建风险点配置
 /// </summary>
 /// <param name="dangerRelation"></param>
 /// <returns></returns>
 public ActionResult<bool> AddDangerRelation(DangerRelationNew dangerRelation)
 {
     try
     {
         if (dangerRelation.DangerID.Count()==0)
         {
             throw new Exception("参数有误");
         }
         var check = _rpsdangerrelation.Any(p=>p.SubjectID==dangerRelation.SubjectID&&dangerRelation.DangerID.Contains(p.DangerID));
         if (check)
         {
             throw new Exception("已存在该风险点配置");
         }
         var dbdangerrelation = from d in dangerRelation.DangerID
                                select new Basic_DangerRelation
                                {
                                    ID=Guid.NewGuid(),
                                    DangerID=d,
                                    SubjectID=dangerRelation.SubjectID
                                };
         _rpsdangerrelation.Add(dbdangerrelation);
         _work.Commit();
         return new ActionResult<bool>(true);
     }
     catch (Exception ex)
     {
         return new ActionResult<bool>(ex);
     }
 }
Ejemplo n.º 2
0
 public ActionResult <bool> AddDangerRelation(DangerRelationNew dangerRelation)
 {
     LogContent = "新建了风险点配置,参数源:" + JsonConvert.SerializeObject(dangerRelation);
     return(bll.AddDangerRelation(dangerRelation));
 }