예제 #1
0
        public ActionResult Index()
        {
            int memberId = Convert.ToInt32(HttpContext.Profile.GetPropertyValue("MemberId"));

            var memberReservations  = _dataService.GetReservationListByMember(memberId);
            var studentReservations = new List <Reservation>();

            if (User.IsInRole("Instructor"))
            {
                studentReservations = _dataService.GetStudentReservationListByInstructor(memberId);
            }

            var model = new ReservationIndexViewModel()
            {
                ReservationList        = memberReservations.ConvertToReservationViewModel(),
                StudentReservationList = studentReservations.ConvertToReservationViewModel()
            };

            return(View(model));
        }