Beispiel #1
0
        public bool Create([FromBody] ProductModel productModel)
        {
            ProductBsn productBsn = new ProductBsn();
            var        result     = productBsn.Insert(productModel);

            return(result);
        }
Beispiel #2
0
        public async Task <ProductModel> Edit(int productId)
        {
            ProductBsn   productBsn   = new ProductBsn();
            ProductModel productModel = await productBsn.GetProductById(productId);

            return(productModel);
        }
Beispiel #3
0
        public async Task <List <BrandsModel> > GetBrands()
        {
            var productBsn            = new ProductBsn();
            List <BrandsModel> brands = productBsn.GetListBrand();

            return(brands);
        }
Beispiel #4
0
        public async Task <List <ProductModel> > GetProductsApi()
        {
            ProductBsn productBsn = new ProductBsn();
            var        products   = await productBsn.GetListProduct();

            return(products);
        }
Beispiel #5
0
        public async Task <List <CategoriesModel> > GetCategories()
        {
            var productBsn = new ProductBsn();
            List <CategoriesModel> categories = await productBsn.GetListCategory();

            return(categories);
        }
Beispiel #6
0
        public async Task <ProductModel> ProductDetail(int productId)
        {
            ProductBsn   productBsn = new ProductBsn();
            ProductModel product    = await productBsn.ProductDetail(productId);

            return(product);
        }
Beispiel #7
0
        public async Task <List <ProductModel> > SortBy(string sortBy)
        {
            ProductBsn          productBsn = new ProductBsn();
            List <ProductModel> products   = productBsn.SortBy(sortBy);

            return(products);
        }
Beispiel #8
0
        public async Task <List <ProductModel> > PriceRange(int min, int max)
        {
            ProductBsn          productBsn = new ProductBsn();
            List <ProductModel> products   = await productBsn.PriceRange(min, max);

            return(products);
        }
Beispiel #9
0
        public async Task <List <ProductModel> > Search(string searchBy)
        {
            ProductBsn          productBsn = new ProductBsn();
            List <ProductModel> products   = productBsn.Search(searchBy);

            return(products);
        }
Beispiel #10
0
        public async Task <List <ProductModel> > GetProductsByCategory(int categoryId)
        {
            ProductBsn          productBsn = new ProductBsn();
            List <ProductModel> products   = productBsn.GetProductsByCategory(categoryId);

            return(products);
        }
Beispiel #11
0
        public bool Delete(int productId)
        {
            ProductBsn productBsn = new ProductBsn();
            var        result     = productBsn.Delete(productId);

            return(result);
        }
Beispiel #12
0
        public bool Edit([FromBody] ProductModel productModel)
        {
            ProductBsn productBsn = new ProductBsn();
            var        result     = productBsn.Update(productModel);

            return(result);
        }
Beispiel #13
0
        public async Task <ProductModel> Create()
        {
            ProductBsn   productBsn   = new ProductBsn();
            ProductModel productModel = new ProductModel();

            productModel.listCategory = await productBsn.GetListCategory();

            productModel.listBrand = productBsn.GetListBrand();
            return(productModel);
        }