public ActionResult Index() { var userId = User.Identity.GetUserName(); if (userRoleRepository.GetRoleByUserName(userId) != null) { List <DepartmentsModel> departments = departmentRepository.GetAllDepartments(); return(View("Index", departments)); } else { return(RedirectToAction("Contact", "Home")); } }
public ActionResult Index() { var userId = User.Identity.GetUserName(); if (userRolesRepository.GetRoleByUserName(userId) != null && userRolesRepository.GetRoleByUserName(userId).IdUserType == "Admin") { List <UsersClustersModel> userRoles = userRolesRepository.GetAllUserRoles(); return(View("Index", userRoles)); } else { return(RedirectToAction("Contact", "Home")); } }
public ActionResult Index() { var userId = User.Identity.GetUserName(); if (userRoleRepository.GetRoleByUserName(userId) != null) { List <FloorsModel> floors = floorRepository.GetAllFloors(); return(View("Index", floors)); } else { return(RedirectToAction("Contact", "Home")); } }
public ActionResult Index() { var userId = User.Identity.GetUserName(); if (userRoleRepository.GetRoleByUserName(userId) != null) { var userRole = userRoleRepository.GetRoleByUserName(userId).IdUserType; var userDepartment = userRoleRepository.GetRoleByUserName(userId).IdDepartment; if (userRole != "Manager" && userRole != "Admin") { List <BookingsModel> bookings = bookingRepository.GetAllBookingsbyUserName(userId); return(View("Index", bookings)); } else { if (userRole != "Admin") { List <BookingsModel> bookings = bookingRepository.GetAllBookingsbyUserDepartment(userDepartment); return(View("Index", bookings)); } else { List <BookingsModel> bookings = bookingRepository.GetAllBookings(); return(View("Index", bookings)); } } } else { return(RedirectToAction("Contact", "Home")); } }
public ActionResult Index() { var userId = User.Identity.GetUserName(); if (userRoleRepository.GetRoleByUserName(userId) != null) { List <OfficeBuildingsModel> officeBuildings = officeRepository.GetAllOfficeBuildings(); return(View("Index", officeBuildings)); } else { return(RedirectToAction("Contact", "Home")); } }