Exemple #1
0
        //
        // 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);
        }
Exemple #2
0
        public ActionResult Create(FormCollection collection)
        {
            var model = new Role();
            this.TryUpdateModel<Role>(model);

            this.AccountService.SaveRole(model);

            return this.RefreshParent();
        }
Exemple #3
0
 public void SaveRole(Role role)
 {
     using (var dbContext = new AccountDbContext())
     {
         if (role.ID > 0)
         {
             dbContext.Update<Role>(role);
         }
         else
         {
             dbContext.Insert<Role>(role);
         }
     }
 }