public ServiceResult Update(SYS_PermissionGroup model) { var result = new ServiceResult(); if (this.groupRepository.Exists(g => g.GroupName == model.GroupName && g.GroupId != model.GroupId)) { return(result.IsFailed("编辑失败,已存在同名权限组")); } this.groupRepository.Update(model); return(result.IsSucceed("更新权限组成功")); }
public ServiceResult Add(SYS_PermissionGroup model) { var result = new ServiceResult(); var ret = this.groupRepository.AddIfNotExists(model, g => g.GroupName == model.GroupName); if (ret > 0) { return(result.IsSucceed("添加权限组成功")); } else { return(result.IsFailed("添加失败,已存在同名权限组")); } }
public ActionResult EditGroupForAjax(SYS_PermissionGroup model) { return(Json(this.groupService.Update(model))); }
public ActionResult AddGroupForAjax(SYS_PermissionGroup model) { model.GroupId = Guid.NewGuid().ToString(); model.CreateTime = DateTime.Now; return(Json(this.groupService.Add(model))); }