Esempio n. 1
0
 public ActionResult EditRequest(int?requestID)
 {
     try
     {
         if (User.IsInRole("Student"))
         {
             ViewBag.errorMessage = TempData["errorMessage"];
             if (requestID == null)
             {
                 return(RedirectToAction("StudentScholarship"));
             }
             else
             {
                 return(View(studentActions.GetRequestByID((int)requestID)));
             }
         }
         else
         {
             TempData["errorMessage"] = "Sorry you do not have access.";
             return(RedirectToAction("Announcement", "WebsiteContent"));
         }
     }
     catch (Exception e)
     {
         TempData["errorMessage"] = "There was an error in displaying the request you wish to edit. Please try again, thank you!";
         return(RedirectToAction("RequestStatus"));
     }
 }