public IActionResult Conclusion(ConclusionViewModel viewModel) { if (ModelState.IsValid) { var model = new ConclusionModel() { Date = viewModel.Date, Doctor = doctorService.GetDoctor(User.Identity.Name), Id = viewModel.ConclusionId, Patient = viewModel.Patient, Result = viewModel.Result, ScheduleId = viewModel.SchedId }; if (viewModel.ConclusionId == Guid.Empty) { conclusionService.Create(model); } else { conclusionService.Update(model); } return(RedirectToAction("AppointmentResult", new { schedId = viewModel.SchedId })); } return(View(viewModel)); }
public IActionResult Conclusion(Guid conclusionId, Guid patientId, Guid schedId) { var conclusionModel = conclusionService.GetConclusion(conclusionId); var viewModel = new ConclusionViewModel() { Date = conclusionModel.Date, ConclusionId = conclusionModel.Id, Patient = conclusionModel.Patient ?? patientService.GetPatient(patientId), Result = conclusionModel.Result, SchedId = conclusionModel.ScheduleId != Guid.Empty ? conclusionModel.ScheduleId : schedId }; return(View(viewModel)); }