Beispiel #1
0
        public ProductResponse GetByID(GetProductRequest request)
        {
            ProductResponse productResponse = new ProductResponse();

            try
            {
                ProductDataAcess _dataAccess = new ProductDataAcess();
                productResponse = _dataAccess.GetByID(request);
            }
            catch (Exception ex)
            {
                Console.WriteLine("ProductModel.GetByID : ERROR : " + ex.Message);
                throw;
            }
            return(productResponse);
        }
Beispiel #2
0
 public int LoadMarca(LoadMarcaRequest request)
 {
     try
     {
         ProductDataAcess _dataAccess = new ProductDataAcess();
         _dataAccess.LoadMarca(request);
         //Retorna 204: La peticion ha sido manejada con exito y la respuesta no tiene contenido
         return(204);
     }
     catch (Exception ex)
     {
         Console.WriteLine("ProductModel.LoadMarca : ERROR : " + ex.Message);
         //Error interno del servidor
         return(500);
     }
 }
Beispiel #3
0
        public GetCatalogResponse GetCatalogSearchBar(GetSearchBarRequest request)
        {
            GetCatalogResponse getCatalogResponse = new GetCatalogResponse();

            try
            {
                ProductDataAcess _dataAccess = new ProductDataAcess();
                var _dataAccessResponse      = _dataAccess.GetCatalogSearchBar(request);
                if (_dataAccessResponse != null)
                {
                    ProductHelper _helper = new ProductHelper();
                    getCatalogResponse = _helper.CreateList(_dataAccessResponse);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("ProductModel.GetCatalogSearchBar : ERROR : " + ex.Message);
                throw;
            }
            return(getCatalogResponse);
        }
Beispiel #4
0
        public GetFiltersResponse GetFilters()
        {
            GetFiltersResponse getFiltersResponse = new GetFiltersResponse();

            try
            {
                ProductDataAcess _dataAccess = new ProductDataAcess();
                var _dataAccessResponse      = _dataAccess.GetFilters();
                if (_dataAccessResponse != null)
                {
                    ProductHelper _helper = new ProductHelper();
                    getFiltersResponse = _helper.CreateCategoryTree(_dataAccessResponse);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("ProductModel.GetFilters : ERROR : " + ex.Message);
                throw;
            }
            return(getFiltersResponse);
        }