예제 #1
0
 private ActionResult EditDictionaryCore(SystemDictionary entity)
 {
     if (entity.ParentId > 0)
     {
         ViewBag.ParentEntity = service.GetDictionary(entity.ParentId);
     }
     return View("DictionaryEdit", entity);
 }
예제 #2
0
 /// <summary>
 /// 更新系统数据字典
 /// </summary>
 /// <param name="entity">系统数据字典实体</param>
 public BoolMessage UpdateDictionary(SystemDictionary entity)
 {
     try
     {
         dicRepos.Update(entity);
         return BoolMessage.True;
     }
     catch (Exception e)
     {
         return new BoolMessage(false, e.Message);
     }
 }
예제 #3
0
 public ActionResult SaveDictionary(SystemDictionary entity)
 {
     var hasResult = service.ExistsDictionary(entity.Code, entity.Id);
     if (hasResult.Failure)
     {
         return Json(hasResult);
     }
     entity.NameSpell = SpellHelper.ConvertSpell(entity.Name);
     var result = entity.Id == 0 ? service.InsertDictionary(entity) : service.UpdateDictionary(entity);
     return Json(result);
 }