Пример #1
0
        public List <ProductOL> GetAllProducts()
        {
            List <ProductOL> objproduct = new List <ProductOL>();

            objproduct = new ProductDL().GetAllProducts();
            return(objproduct);
        }
        //**
        public void Update(ProductLL productLL)
        {
            if (productLL == null)
            {
                throw new ValidationException("Product not found on Update", "");
            }
            ProductDL productDL = new ProductDL
            {
                ProductId  = productLL.ProductId,
                Name       = productLL.Name,
                Price      = productLL.Price,
                CategoryId = productLL.CategoryId,
                ImgLink    = productLL.ImgLink
            };

            Database.Products.Update(productDL);
            Database.Save();
        }
Пример #3
0
 /// <summary>
 /// Hàm khởi tạo mặc định
 /// </summary>
 /// Người tạo: ntxuan (20/6/2019)
 public ProductBL()
 {
     productDL = new ProductDL();
 }
Пример #4
0
 public ProductBL(string connectionString)
 {
     productDL = new ProductDL(connectionString);
 }
Пример #5
0
 public ProductBL()
 {
     this.productDL = new ProductDL();
 }