Beispiel #1
0
        public async Task <IActionResult> GetAll()
        {
            var result = await _specialtyService.GetAll();

            if (result == null)
            {
                return(NotFound("Collection is empty!"));
            }

            var response = _mapper.Map <IEnumerable <SpecialtyResponse> >(result);

            return(Ok(response));
        }
Beispiel #2
0
        public ActionResult AddOrEdit(int id = 0)
        {
            var patient = productService.GetById(id);

            if (patient == null)
            {
                patient = new Product();
            }

            //Category
            var categories = categoryService
                             .GetAll()
                             .Select(c => new SelectListItem
            {
                Text  = c.Description,
                Value = c.Id.ToString()
            })
                             .ToList();

            categories.Insert(0, new SelectListItem {
                Value = 0.ToString(), Text = "CATEGORÍA", Selected = false
            });

            //Category
            var specialties = specialtyService
                              .GetAll()
                              .Select(c => new SelectListItem
            {
                Text  = c.Description,
                Value = c.Id.ToString()
            })
                              .ToList();

            specialties.Insert(0, new SelectListItem {
                Value = 0.ToString(), Text = "ESPECIALIDAD", Selected = false
            });

            ViewBag.Category  = categories;
            ViewBag.Specialty = specialties;

            return(PartialView(patient));
        }
Beispiel #3
0
        public IActionResult GetAll()
        {
            var specialties = _specialtyService.GetAll().Select(s => s.GetMemento());

            return(Ok(specialties));
        }
        public IEnumerable <Specialty> Get()
        {
            var result = _specialtyService.GetAll();

            return(result);
        }
        public ActionResult GetAll()
        {
            var result = _service.GetAll();

            return(Ok(result));
        }