Ejemplo n.º 1
0
        public ActionResult AddInformation(int appointmentId)
        {
            var viewModel = new AddAppointmentInformationViewModel();

            viewModel.AppointmentId = appointmentId;
            return(View(viewModel));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }