public ActionResult AddInformation(int appointmentId) { var viewModel = new AddAppointmentInformationViewModel(); viewModel.AppointmentId = appointmentId; return(View(viewModel)); }
public async Task <bool> UpdateAppointmentInformation(AddAppointmentInformationViewModel viewModel) { var originalModel = await _repository.GetAppointmentById(viewModel.AppointmentId); originalModel.Diagnostic = viewModel.Diagnostic; originalModel.Observations = viewModel.Observation; return(await _repository.UpdateAppointment(originalModel)); }
public async Task <ActionResult> AddInformation(AddAppointmentInformationViewModel viewModel) { if (ModelState.IsValid) { var success = await VetService.UpdateAppointmentInformation(viewModel); if (success) { TempData["success"] = "success"; return(RedirectToAction("AppointmentManagment")); } } ViewBag.Failed = "Something went wrong with the update"; return(View(viewModel)); }