I have a controller that loads some dropdowns based on the user type. For example:
public ActionResult Index()
{
switch (SessionHelper.ViewLimit)
{
case "C":
ViewData["CustDivision"] = LoadCustDivisions();
ViewData["Customer"] = LoadCustomers();
break;
case "P":
ViewData["Customer"] = LoadCustomers();
ViewData["Employee"] = LoadEmployees();
break;
case "D":
ViewData["Customer"] = LoadCustomers();
ViewData["Division"] = LoadDivisions();
break;
default:
return RedirectToAction("Logout", "Account");
}
return View()
}
First of all, does the switch statement belong in the controller and second of all if so, where should I put LoadCustomers(), LoadDivisions(), LoadEmployees()?