public List <ReservationViewDTO> GetReservationHistory(string userID) { var reservationsView = new List <ReservationViewDTO>(); var reservations = _database.ReservationManager.Get().Where(s => s.ApplicationUser.Id == userID && s.ConfirmReservation.IsConfirm == true); foreach (var reservation in reservations) { var reservationView = new ReservationViewDTO { BreakdownDetails = reservation.BreakdownDetails, DesiredDiagnosis = reservation.DesiredDiagnosis, Purpose = reservation.Purpose, DateStart = DateTime.SpecifyKind(reservation.DateStart, DateTimeKind.Utc), DateEnd = DateTime.SpecifyKind(reservation.DateEnd, DateTimeKind.Utc), NameWorker = string.Format("{0} {1}", reservation.Worker.FirstName, reservation.Worker.SurName), Image = _database.ImageManager.Get(reservation.Id).Select(s => s.URL).ToList() }; reservationsView.Add(reservationView); } return(reservationsView); }
public List <ReservationViewDTO> GetReservationToday() { var reservationsView = new List <ReservationViewDTO>(); var reservations = _database.ReservationManager.Get().Where(s => ( s.DateStart.Day == _clock.CurentUtcDateTime().Day || s.DateEnd.Day == _clock.CurentUtcDateTime().Day) && s.ConfirmReservation.IsConfirm); foreach (var reservation in reservations) { var reservationView = new ReservationViewDTO { BreakdownDetails = reservation.BreakdownDetails, DesiredDiagnosis = reservation.DesiredDiagnosis, Purpose = reservation.Purpose, DateStart = DateTime.SpecifyKind(reservation.DateStart, DateTimeKind.Utc), DateEnd = DateTime.SpecifyKind(reservation.DateEnd, DateTimeKind.Utc), NameWorker = string.Format("{0} {1}", reservation.Worker.FirstName, reservation.Worker.SurName), Image = _database.ImageManager.Get(reservation.Id).Select(s => s.URL).ToList() }; reservationsView.Add(reservationView); } return(reservationsView); }