public ActionResult Create(string RoleName) { if (RoleName != null) { roleAppService.Create(RoleName); } ViewBag.RoleName = RoleName; return(View()); }
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()); }
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()); }