Exemplo n.º 1
0
        /// <summary>
        /// 修改操作模型
        /// </summary>
        /// <param name="opreation"></param>
        /// <returns></returns>
        public ActionResult <bool> EditOpreation(OpreationEdit opreation)
        {
            try
            {
                var dbopreation = _rpsopreation.GetModel(q => q.ID == opreation.ID);
                if (dbopreation == null)
                {
                    throw new Exception("未找到该操作信息");
                }
                var check = _rpsopreation.Any(p => p.ID != opreation.ID && p.Name == opreation.Name);
                if (check)
                {
                    throw new Exception("已经存在相同的操作:" + opreation.Name);
                }
                dbopreation = opreation.CopyTo <Basic_Opreation>(dbopreation);

                usedefinedService.DeleteBusinessValue(dbopreation.ID);
                var definevalue = new UserDefinedBusinessValue
                {
                    BusinessID = dbopreation.ID,
                    Values     = opreation.UserDefineds
                };
                var defined = usedefinedService.SaveBuisnessValue(definevalue);
                if (defined.state != 200)
                {
                    throw new Exception(defined.msg);
                }
                _rpsopreation.Update(dbopreation);


                _work.Commit();
                return(new ActionResult <bool>(true));
            }
            catch (Exception ex)
            {
                return(new ActionResult <bool>(ex));
            }
        }
Exemplo n.º 2
0
 public ActionResult <bool> EditOpreation(OpreationEdit opreation)
 {
     LogContent = "修改了操作模型,参数源:" + JsonConvert.SerializeObject(opreation);
     return(bll.EditOpreation(opreation));
 }