Exemple #1
0
        public override bool Update(ProductBase product)
        {
            string command = $"UPDATE TB_Product SET" +
                             $" [SKU]=@SKU, [Type]=@Type, [Name]=@Name, [Description]=@Description, [Img]=@Img, [Size]=@Size, [Color]=@Color " +
                             $"WHERE ID={product.Id}";
            ProductMapper mapper = new ProductMapper();

            return(DAL.ManageEntity(command, mapper.GetParametersFromProduct(product)));
        }
Exemple #2
0
        public override bool Create(ProductBase product)
        {
            string command = $"INSERT INTO TB_Product ([SKU], [Type], [Name], [Description], [Img], [Size], [Color]) " +
                             $"VALUES (@SKU, @Type, @Name, @Description, @Img, @Size, @Color)";

            ProductMapper mapper = new ProductMapper();

            return(DAL.ManageEntity(command, mapper.GetParametersFromProduct(product)));
        }