// // GET: /Account/Role/Create public ActionResult Create() { var businessPermissionList = EnumHelper.GetItemValueList<EnumBusinessPermission>(); this.ViewBag.BusinessPermissionList = new SelectList(businessPermissionList, "Key", "Value"); var model = new Role(); return View("Edit", model); }
public ActionResult Create(FormCollection collection) { var model = new Role(); this.TryUpdateModel<Role>(model); this.AccountService.SaveRole(model); return this.RefreshParent(); }
public void SaveRole(Role role) { using (var dbContext = new AccountDbContext()) { if (role.ID > 0) { dbContext.Update<Role>(role); } else { dbContext.Insert<Role>(role); } } }