public GetReceptionUserMarkClientsPageInformationCommandAnswer GetReceptionUserMarkClientsPageInformation( GetReceptionUserMarkClientsPageInformationCommand command) { var reservations = this.reservationRepository.GetModels(); var user = tokenManager.GetUserByToken(command.Token.Value); var hospital = hospitalManager.GetHospitalByUser(user); var now = DateTime.Now.Date; var table = reservations .Where(model => model.EmptyPlaceByTypeStatistic.EmptyPlaceStatistic.HospitalSectionProfile.HospitalId == hospital.Id) .Where(model => model.EmptyPlaceByTypeStatistic.EmptyPlaceStatistic.Date == now) .Where(model => model.CancelTime == null) .Select(model => new ReceptionClientTableItem { FirstName = model.Patient.FirstName, LastName = model.Patient.LastName, ClientCode = model.Patient.Code, ClinicName = model.Clinic.Name, SectionName = model.EmptyPlaceByTypeStatistic.EmptyPlaceStatistic.HospitalSectionProfile.Name, ReservationId = model.Id }) .ToList(); var result = new GetReceptionUserMarkClientsPageInformationCommandAnswer { Token = (Guid)command.Token, Date = DateTime.Now, TableItems = table }; return result; }
public ActionResult Index(GetReceptionUserMarkClientsPageInformationCommand command) { var answer = _receptionMarkingService.GetReceptionUserMarkClientsPageInformation(command); return View(answer); }