public ActionResult CreateRole(Role role) { User user = uService.GetSingleUserByEmail(HttpContext.User.Identity.Name); var accountsetting = setService.GetAllByUserId(user.Id); var logObj = _companyViewLog.GetLastViewCompanyByUserId(user.Id); //role.CompanyId = accountsetting.Companies.Id; role.CompanyId = logObj.Companies.Id; if (rService.AddRole(role)) return RedirectToAction("Index"); else return Content("Failed to add Role"); }
public bool EditRole(Role role) { try { role.State = ObjectState.Modified; roleRep.UpdateOperation(role); return true; } catch (Exception ex) { var rr = ex.Message; return false; } }
public bool AddRole(Role role) { try { role.State = ObjectState.Added; roleRep.AddOperation(role); return true; } catch (Exception ex) { var rr = ex.Message; return false; } }
public ActionResult EditRole(Role role) { rService.EditRole(role); //return View(); return RedirectToAction("Index"); }