/// <summary> /// 新建作业模型 /// </summary> /// <param name="opreation"></param> /// <returns></returns> public ActionResult <bool> AddOpreation(OpreationNew opreation) { try { if (opreation == null) { throw new Exception("参数有误"); } var check = _rpsopreation.Any(q => q.Name == opreation.Name); if (check) { throw new Exception("已经存在相同的操作 :" + opreation.Name); } var _opreation = opreation.MAPTO <Basic_Opreation>(); var definedvalue = new UserDefinedBusinessValue { BusinessID = _opreation.ID, Values = opreation.UserDefineds }; var defined = usedefinedService.SaveBuisnessValue(definedvalue); if (defined.state != 200) { throw new Exception(defined.msg); } _rpsopreation.Add(_opreation); _work.Commit(); return(new ActionResult <bool>(true)); } catch (Exception ex) { return(new ActionResult <bool>(ex)); } }
public ActionResult <bool> AddOpreation(OpreationNew opreation) { LogContent = "新建操作,参数源:" + JsonConvert.SerializeObject(opreation); return(bll.AddOpreation(opreation)); }