public ActionResult Index() { if (Session["ClientId"] != null) { ClientSettings clientSetting = ClientModels.GetClientSettingsByClientId((int)Session["ClientId"]); ViewData["clientSetting"] = clientSetting; Session["clientSetting"] = clientSetting; } return(View()); }
public ActionResult Settings(int?id) { if (Session["ClientId"] != null) { ViewData["Client"] = ClientModels.GetClientDetailsById((int)Session["ClientId"]); ViewData.Model = ClientModels.GetClientSettingsByClientId((int)Session["ClientId"]); return(View()); } else { if (Roles.IsUserInRole("SuperAdmin")) { if (id != null) { ViewData["Client"] = ClientModels.GetClientDetailsById((int)id); ViewData.Model = ClientModels.GetClientSettingsByClientId((int)id); return(View()); } else { if (Roles.IsUserInRole("SuperAdmin")) { return(RedirectToAction("List", "Client")); } else { FormsAuthentication.SignOut(); return(RedirectToAction("LogOff", "Account")); } } } else { FormsAuthentication.SignOut(); return(RedirectToAction("LogOff", "Account")); } } }