Ejemplo n.º 1
0
 public ActionResult AllLeaves()
 {
     var currentUser = Request.GetOwinContext().Authentication.User;
     var model = new CalendarModel
     {
         IsUserAdmin = currentUser.IsInRole("Admin"),
         InstructorList = new SelectList(_instructorRepo.GetInstructorNames(), "Value", "Text")
     };
     return View(model);
 }
Ejemplo n.º 2
0
 public ActionResult Calendar()
 {
     var currentUser = Request.GetOwinContext().Authentication.User;
     var currentUserId = currentUser.Identity.GetUserId();
     var currentInstructor = _instructorRepo.TblInstructors.FirstOrDefault(s=>s.InstructorId == currentUserId);
     var model = new CalendarModel
     {
         IsUserAdmin = currentUser.IsInRole("Admin"),
         InstructorList = currentInstructor != null ? new SelectList(_instructorRepo.GetInstructorNames(), "Value", "Text",currentInstructor.InstructorNumber) : new SelectList(_instructorRepo.GetInstructorNames(), "Value", "Text")
     };
     return View(model);
 }