public ActionResult <Vet> Post([FromBody] Vet vet) { var service = new VetService(); service.Store(vet); return(vet); }
public ActionResult <IEnumerable <Vet> > Get() { var service = new VetService(); var vets = service.GetAll(); return(Ok(vets)); }
public ActionResult <Vet> Get(long id) { var service = new VetService(); var vet = service.GetID(id); if (vet == null) { return(NotFound()); } return(vet); }
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)); }
public ActionResult Delete(long id) { var service = new VetService(); var vet = service.GetID(id); if (vet == null) { return(NotFound()); } service.Delete(vet); return(Ok()); }
public ActionResult <Vet> Put(long id, [FromBody] Vet vet) { var service = new VetService(); if (service.GetID(id) == null) { return(NotFound()); } vet.VetID = id; service.Store(vet); return(vet); }
public async Task <ActionResult> AppointmentManagment() { if (TempData["success"] != null) { ViewBag.Success = "The appointment information was updated"; } var viewModel = new VetManagmentViewModel(); viewModel.TodayAppointments = await VetService.GetTodayAppoinments(); viewModel.PastAppointments = await VetService.GetPastAppoitnments(); viewModel.FutureAppoitments = await VetService.GetFutureAppoitnments(); return(View(viewModel)); }