private ActionResult EditDictionaryCore(SystemDictionary entity) { if (entity.ParentId > 0) { ViewBag.ParentEntity = service.GetDictionary(entity.ParentId); } return View("DictionaryEdit", entity); }
/// <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); } }
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); }