예제 #1
0
 public ActionResult List(DateTime fromDate, DateTime toDate)
 {
     var username = HttpContext.User.Identity.Name;
     var reservations = new ListReservationsModel(username, _reservationService.GetRestaurantReservations(username).Where(x => x.TimeSlot.Date >= fromDate.Date && x.TimeSlot.Date <= toDate.Date).OrderBy(x => x.TimeSlot));
     reservations.FromDate = fromDate;
     reservations.ToDate = toDate;
     return View(reservations);
 }
예제 #2
0
 public ActionResult List()
 {
     var username = HttpContext.User.Identity.Name;
     var model = new ListReservationsModel(username, _reservationService.GetRestaurantReservations(username).Where(x => x.TimeSlot.Date >= DateTime.Now.Date && x.TimeSlot.Date <= DateTime.Now.AddDays(6).Date).OrderBy(x => x.TimeSlot));
     model.FromDate = DateTime.Now.Date;
     model.ToDate = DateTime.Now.AddDays(6).Date;
     return View(model);
 }