private ServiceEvaluationViewModel GetFilledServiceEvaluationViewModel() { ServiceEvaluationViewModel viewModel = new ServiceEvaluationViewModel { FioPatient = HttpContext.Session.GetString("fioPatient"), BirthdayPatient = HttpContext.Session.GetString("birthdayPatient"), NameLpu = HttpContext.Session.GetString("nameCurrentLpu"), AddressLpu = HttpContext.Session.GetString("addressCurrentLpu") }; List <AppointmentQualityDBModel> appointmentQuality = null; using (DataBaseContext db = new DataBaseContext()) { appointmentQuality = db.AppointmentQuality.Where(a => a.FioPatient == viewModel.FioPatient && (a.DateAppointment == DateTime.Today || a.DateAppointment == DateTime.Today.AddDays(-1)) && a.Rating == 0).ToList(); } int page = 1; int itemPageCount = 2; int count = appointmentQuality.Count(); var items = appointmentQuality.Skip((page - 1) * itemPageCount).Take(itemPageCount).ToList(); PaginationViewModel pageViewModel = new PaginationViewModel(count, page, itemPageCount); viewModel.AppointmentQuality = items; viewModel.PaginationViewModel = pageViewModel; return(viewModel); }
public async Task <IActionResult> Login(AuthorizationModel model) { var patient = autorizationPatientHelper.GetPatientInfo(model.PolisOMSNumber); if (patient != null) { HttpContext.Session.SetString("polisNPatient", patient.NPolis); HttpContext.Session.SetString("fioPatient", patient.FIO); HttpContext.Session.SetString("birthdayPatient", patient.Birthday.ToShortDateString()); if (HttpContext.Session.GetString("nextPathKey") == "AppointmentWithDoctor") { AppointmentWithDoctorViewModel viewModel = GetFilledAppointmentWithDoctorViewModel(patient, "SelectLpu"); return(View("~/Views/AppointmentWithDoctor/AppointmentWithDoctorSelectLpu.cshtml", viewModel)); } else if (HttpContext.Session.GetString("nextPathKey") == "ServiceEvaluation") { ServiceEvaluationViewModel viewModel = GetFilledServiceEvaluationViewModel(); return(View("~/Views/ServiceEvaluation/ServiceEvaluationSelectAppointment.cshtml", viewModel)); } else if (HttpContext.Session.GetString("nextPathKey") == "ViewingAndCancelRecording") { ViewingAndCancelRecordingViewModel viewModel = GetFilledViewingAndCancelRecordingViewModel(); return(View("~/Views/ViewingAndCancelRecording/ViewingAndCancelRecordingSelectRecording.cshtml", viewModel)); } else if (HttpContext.Session.GetString("nextPathKey") == "AppointmentWithCOVID19") { AppointmentWithDoctorViewModel viewModel = GetFilledAppointmentWithDoctorViewModel(patient, "SelectLpu"); return(View("~/Views/AppointmentWithDoctor/AppointmentWithDoctorSelectLpu.cshtml", viewModel)); } //else if (HttpContext.Session.GetString("nextPathKey") == "RegistrMedicalExamination") //{ //} else { ErrorModel errorModel = new ErrorModel(); errorModel.IdError = "nextPathKeyIsNULL"; errorModel.TextError = "Необходимая страница не найдена. Обратитесь к администратору системы"; return(View("~/Views/Home/ErrorModel.cshtml", errorModel)); } } else { ViewBag.ErrorString = "*пациент по введенному номеру полиса не найден"; return(View("~/Views/Authorization/Authorization.cshtml")); } }
public async Task <IActionResult> ServiceEvaluationSetRaiting(string idSelectAppointment) { HttpContext.Session.SetString("idSelectAppointment", idSelectAppointment); var selectAppointment = dataHelper.GetAppointment(idSelectAppointment); ServiceEvaluationViewModel viewModel = new ServiceEvaluationViewModel { IdPatient = HttpContext.Session.GetString("idPatient"), FioPatient = HttpContext.Session.GetString("fioPatient"), BirthdayPatient = HttpContext.Session.GetString("birthdayPatient"), NameLpu = HttpContext.Session.GetString("nameCurrentLpu"), AddressLpu = HttpContext.Session.GetString("nameCurrentLpu"), SelectAppointment = selectAppointment }; return(View("~/Views/ServiceEvaluation/ServiceEvaluationSetRaiting.cshtml", viewModel)); }
public IActionResult PaginationServiceEvaluationSelectAppointment(int page = 1) { ServiceEvaluationViewModel viewModel = new ServiceEvaluationViewModel(); List <AppointmentQualityDBModel> appointmentQuality = null; string fioPatient = HttpContext.Session.GetString("fioPatient"); using (DataBaseContext db = new DataBaseContext()) { appointmentQuality = db.AppointmentQuality.Where(a => a.FioPatient == fioPatient && (a.DateAppointment == DateTime.Today || a.DateAppointment == DateTime.Today.AddDays(-1)) && a.Rating == 0).ToList(); } int itemPageCount = 2; int count = appointmentQuality.Count(); var items = appointmentQuality.Skip((page - 1) * itemPageCount).Take(itemPageCount).ToList(); PaginationViewModel pageViewModel = new PaginationViewModel(count, page, itemPageCount); viewModel.AppointmentQuality = items; viewModel.PaginationViewModel = pageViewModel; return(PartialView("~/Views/Pagination/PaginationServiceEvaluationSelectAppointment.cshtml", viewModel)); }
public async Task <IActionResult> ServiceEvaluationSelectAppointment() { ServiceEvaluationViewModel viewModel = GetFilledServiceEvaluationViewModel(); return(View("~/Views/ServiceEvaluation/ServiceEvaluationSelectAppointment.cshtml", viewModel)); }