// GET: api/Concesionarios
 public IEnumerable <MarcaViewModel> Get()
 {
     return(marcaService.GetAll().Select(m => new MarcaViewModel()
     {
         Id = m.Id,
         Nombre = m.Nombre
     }));
 }
        public ActionResult Buscar(string filterByName)
        {
            filterByName = filterByName != null ? filterByName : "";

            var model = marcaServices.GetAll(filterByName);

            return(PartialView("IndexListado", model));
        }
Exemple #3
0
        // GET: Producto
        public ActionResult IndexVM(ProductoSearchViewModel model)
        {
            model.Categorias = categoriaService.GetAll("").ToList();
            model.Marcas     = marcaService.GetAll("").ToList();
            var filterByName = string.IsNullOrWhiteSpace(model.FilterByName) ? "" : model.FilterByName.Trim();

            model.Productos = productoService.GetAll(filterByName, model.FilterByCategoria).ToList();

            return(View(model));
        }
Exemple #4
0
        public void Deve_remover_marcas_corretamente()
        {
            var marcaGuid = _testHelper.InsertMarca();
            var marca     = _marcaService.Find(marcaGuid);

            Assert.IsNotNull(marca);

            _marcaService.Remove(marca.Id);

            var response = _marcaService.GetAll(new MarcaFilter("")).FirstOrDefault(f => f.Id.Equals(marca.Id));

            Assert.IsNull(response);
        }
Exemple #5
0
        // GET: Producto
        public ActionResult Index(string filterByName, int?filterByCategoria, int?filterByMarca)
        {
            filterByName         = string.IsNullOrWhiteSpace(filterByName) ? "" : filterByName.Trim();
            ViewBag.filterByName = filterByName;
            ViewBag.Categorias   = categoriaService.GetAll("");
            ViewBag.Marcas       = marcaService.GetAll("");
            var model = productoService.GetAll(filterByName, filterByCategoria, filterByMarca);

            return(View(model));
        }
Exemple #6
0
 public IEnumerable <MarcaViewModel> ObterTodos(bool @readonly = false)
 {
     return(_mapper.Map <IEnumerable <MarcaViewModel> >(_marcaService.GetAll(@readonly)));
 }
Exemple #7
0
        public IActionResult GetAll()
        {
            var response = _marcaService.GetAll();

            return(Ok(response.ObjectResponse));
        }
Exemple #8
0
        // GET: Marca
        public ActionResult Index()
        {
            var model = marcaService.GetAll("");

            return(View(model));
        }
Exemple #9
0
 public IEnumerable<MarcaResponseViewModel> GetAll()
 {
     return _mapper.Map<IEnumerable<MarcaResponseViewModel>>(_marcaService.GetAll());
 }
Exemple #10
0
 public IList <MarcaDTO> Get()
 {
     return(Service.GetAll());
 }