Ejemplo n.º 1
0
        public ActionResult <Vet> Post([FromBody] Vet vet)
        {
            var service = new VetService();

            service.Store(vet);

            return(vet);
        }
Ejemplo n.º 2
0
        public ActionResult <IEnumerable <Vet> > Get()
        {
            var service = new VetService();

            var vets = service.GetAll();

            return(Ok(vets));
        }
Ejemplo n.º 3
0
        public ActionResult <Vet> Get(long id)
        {
            var service = new VetService();

            var vet = service.GetID(id);

            if (vet == null)
            {
                return(NotFound());
            }

            return(vet);
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
0
        public ActionResult Delete(long id)
        {
            var service = new VetService();

            var vet = service.GetID(id);

            if (vet == null)
            {
                return(NotFound());
            }

            service.Delete(vet);

            return(Ok());
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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));
        }