public IActionResult Index(int id, string lang) { string role = DBHandler.GetTempRole(this); if (role != "Teacher") { return(RedirectToAction("Index", "Login")); } ViewBag.glossary = GetGlossary(lang); ViewBag.lang = lang != null ? lang : "EN"; Location location = null; if (id != 0) { location = DBHandler.GetLocations().FirstOrDefault(x => x.LocationId.Equals(id)); location.Category = DBHandler.GetCategories().FirstOrDefault(x => x.CategoryId.Equals(location.CategoryId)); location.BuildingFloor = DBHandler.GetBuildingFloors().FirstOrDefault(x => x.BuildingFloorId.Equals(location.BuildingFloorId)); } return(View(location)); }
public string GetUserRole() { return(DBHandler.GetTempRole(this)); }