Example #1
0
 public ActionResult Create(string RoleName)
 {
     if (RoleName != null)
     {
         roleAppService.Create(RoleName);
     }
     ViewBag.RoleName = RoleName;
     return(View());
 }
Example #2
0
 public ActionResult AddRole(string Name)
 {
     if (Name != null)
     {
         IdentityResult result = roleAppService.Create(Name);
         if (result.Succeeded)
         {
             TempData["Msg"] = "New Role Added Successfully";
             return(RedirectToAction("Index"));
         }
         ViewBag.IdentityResultErrors = result.Errors;
     }
     else
     {
         ViewBag.Error = "Role Cant Be Empty";
     }
     return(View());
 }
Example #3
0
 public ActionResult Create(string RoleName)
 {
     if (RoleName != null)
     {
         IdentityResult result = roleAppService.Create(RoleName);
         if (result.Succeeded)
         {
             return(RedirectToAction("Index", "Dealers"));
         }
         ViewBag.Error2 = result.Errors;
     }
     else
     {
         ViewBag.Error1 = "Role Can't Be Empty";
     }
     ViewBag.RoleName = RoleName;
     return(View());
 }