public ActionResult InactiveResourceList()
 {
     if (IsUserLoggedIn())
     {
         if (IsAdmin())
         {
             try
             {
                 var resourceList = _resourceService.GetAllInactive();
                 var model        = new StandardIndexViewModel(resourceList);
                 return(View("ResourceList", model));
             }
             catch (Exception e)
             {
                 Console.WriteLine(e);
             }
             return(View());
         }
         else
         {
             ModelState.AddModelError("", USER_ACCESS_ERR_MSG);
             return(View("Error"));
         }
     }
     else
     {
         ModelState.AddModelError("", USER_LOGIN_ERR_MSG);
     }
     return(RedirectToAction("Login", "Standard", new { area = "" }));
 }
        // GET: Student
        public ViewResult Index(string sortOrder, string currentFilter, string searchString, int?page)
        {
            var facilities = _facilityService.GetAll();
            var model      = new StandardIndexViewModel(facilities);

            return(View("Index", model));
        }
 // GET: Resource/Details/5
 public ActionResult ResourceList()
 {
     if (IsUserLoggedIn())
     {
         if (IsAdmin())
         {
             try
             {
                 var resourceList = _resourceService.GetAll();
                 var model        = new StandardIndexViewModel(resourceList);
                 return(View("ResourceList", model));
             }
             catch (Exception e)
             {
                 ModelState.AddModelError("", "Unable to Retrive Resources. PLease try again later.");
             }
             return(View());
         }
         else
         {
             ModelState.AddModelError("", USER_ACCESS_ERR_MSG);
             return(View("Error"));
         }
     }
     else
     {
         ModelState.AddModelError("", USER_LOGIN_ERR_MSG);
     }
     return(RedirectToAction("Login", "Standard", new { area = "" }));
 }
Exemplo n.º 4
0
        // GET: User
        public ActionResult UserList()
        {
            var users = _userService.GetAll();
            var model = new StandardIndexViewModel(users);

            return(View("UserList", model));
        }
 // GET: Standard/Details/5
 public ActionResult UserHome()
 {
     if (IsUserLoggedIn())
     {
         if (CurrentUser == null)
         {
             CurrentUser = _userService.GetByUserName(Session["username"].ToString());
         }
         var facilities = CurrentUser.Facilities;
         var model      = new StandardIndexViewModel(facilities);
         return(View("UserHome", model));
     }
     return(RedirectToAction("Login"));
 }
 public ActionResult ViewReport()
 {
     if (IsUserLoggedIn())
     {
         if (IsAdmin())
         {
             var facilities = _facilityService.GetAll();
             var model      = new StandardIndexViewModel(facilities);
             return(View("ViewReport", model));
         }
         else
         {
             ModelState.AddModelError("", USER_ACCESS_ERR_MSG);
             return(View());
         }
     }
     else
     {
         ModelState.AddModelError("", USER_LOGIN_ERR_MSG);
     }
     return(RedirectToAction("Login", "Standard", new { area = "" }));
 }
 public ViewResult InactiveFacilityList(string sortOrder, string currentFilter, string searchString, int?page)
 {
     if (IsUserLoggedIn())
     {
         if (IsAdmin())
         {
             var facilities = _facilityService.GetAllInactive();
             var model      = new StandardIndexViewModel(facilities);
             return(View("FacilityList", model));
         }
         else
         {
             ModelState.AddModelError("", USER_ACCESS_ERR_MSG);
             return(View("Error"));
         }
     }
     else
     {
         ModelState.AddModelError("", USER_LOGIN_ERR_MSG);
     }
     return(View("Error"));
 }
 // GET: Student
 public ActionResult FacilityList(string sortOrder, string currentFilter, string searchString, int?page)
 {
     if (IsUserLoggedIn())
     {
         if (IsAdmin())
         {
             var facilities = _facilityService.GetAll();
             var model      = new StandardIndexViewModel(facilities);
             return(View("FacilityList", model));
         }
         else
         {
             ModelState.AddModelError("", USER_ACCESS_ERR_MSG);
             return(View("Error"));
         }
     }
     else
     {
         ModelState.AddModelError("", USER_LOGIN_ERR_MSG);
     }
     return(RedirectToAction("Login", "Standard", new { area = "" }));
 }
Exemplo n.º 9
0
 // GET: User
 public ActionResult InactiveUserList()
 {
     if (IsUserLoggedIn())
     {
         if (IsAdmin())
         {
             var users = _userService.GetAllInactive();
             var model = new StandardIndexViewModel(users);
             return(View("UserList", model));
         }
         else
         {
             ModelState.AddModelError("", USER_ACCESS_ERR_MSG);
             return(View("Error"));
         }
     }
     else
     {
         ModelState.AddModelError("", USER_LOGIN_ERR_MSG);
     }
     return(RedirectToAction("Login", "Standard", new { area = "" }));
 }