コード例 #1
0
 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));
 }
コード例 #2
0
        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));
        }