public void Add(PsProductAttribute Obj, UInt32 IDShop)
        {
            this.DBPrestashop.PsProductAttribute.InsertOnSubmit(Obj);
            this.Save();

            //Si le productattribute n'existe pas dans la boutique, il est rajouté.
            if (!ExistInShop(Obj.IDProductAttribute, IDShop))
            {
                DBPrestashop.PsProductAttributeShop.InsertOnSubmit(new PsProductAttributeShop()
                {
                    AvailableDate      = Obj.AvailableDate,
                    DefaultOn          = Obj.DefaultOn,
                    EcOtAx             = Obj.EcOtAx,
                    IDProductAttribute = Obj.IDProductAttribute,
                    IDShop             = IDShop,
                    MinimalQuantity    = Obj.MinimalQuantity,
                    Price           = Obj.Price,
                    UnitPriceImpact = Obj.UnitPriceImpact,
                    Weight          = Obj.Weight,
                    WholesalePrice  = Obj.WholesalePrice,
                                        #if (PRESTASHOP_VERSION_161 || PRESTASHOP_VERSION_172)
                    IDProduct = Obj.IDProduct,
                                        #endif
                });
                DBPrestashop.SubmitChanges();
                new PsProductAttributeShopRepository().WriteDate(Obj.IDProductAttribute);
            }
        }
Ejemplo n.º 2
0
        public void Add(PsAttribute Obj, UInt32 IDShop)
        {
            this.DBPrestashop.PsAttribute.InsertOnSubmit(Obj);
            this.Save();

            //Si l'énuméré n'existe pas dans la boutique, il est rajouté.
            if (!ExistInShop(Obj.IDAttribute, IDShop))
            {
                DBPrestashop.PsAttributeShop.InsertOnSubmit(new PsAttributeShop()
                {
                    IDAttribute = Obj.IDAttribute,
                    IDShop      = IDShop,
                });
                DBPrestashop.SubmitChanges();
            }
        }
Ejemplo n.º 3
0
        public void Add(PsSupplier Obj, UInt32 IDShop)
        {
            this.DBPrestashop.PsSupplier.InsertOnSubmit(Obj);
            this.Save();

            //Si le fournisseur n'existe pas dans la boutique, il est rajouté.
            if (!ExistInShop(Obj.IDSupplier, IDShop))
            {
                DBPrestashop.PsSupplierShop.InsertOnSubmit(new PsSupplierShop()
                {
                    IDSupplier = Obj.IDSupplier,
                    IDShop     = IDShop,
                });
                DBPrestashop.SubmitChanges();
            }
        }
        public void Add(PsProduct Obj, UInt32 IDShop)
        {
            this.DBPrestashop.PsProduct.InsertOnSubmit(Obj);
            this.Save();

            //Si le produit n'existe pas dans la boutique, il est rajouté.
            if (!ExistInShop(Obj.IDProduct, IDShop))
            {
                DBPrestashop.PsProductShop.InsertOnSubmit(new PsProductShop()
                {
                    Active = Obj.Active,
                    AdditionalShippingCost  = Obj.AdditionalShippingCost,
                    AdvancedStockManagement = Obj.AdvancedStockManagement,
                    AvailableDate           = Obj.AvailableDate,
                    AvailableForOrder       = Obj.AvailableForOrder,
                    CacheDefaultAttribute   = Obj.CacheDefaultAttribute,
                    Customizable            = Obj.Customizable,
                    DateAdd           = Obj.DateAdd,
                    DateUpd           = Obj.DateUpd,
                    EcOtAx            = Obj.EcOtAx,
                    IDCategoryDefault = Obj.IDCategoryDefault,
                    IDProduct         = Obj.IDProduct,
                    IDShop            = IDShop,
                    IDTaxRulesGroup   = Obj.IDTaxRulesGroup,
                    Indexed           = Obj.Indexed,
                    MinimalQuantity   = Obj.MinimalQuantity,
                    OnlineOnly        = Obj.OnlineOnly,
                    OnSale            = Obj.OnSale,
                    Price             = Obj.Price,
                    ShowPrice         = Obj.ShowPrice,
                    TextFields        = Obj.TextFields,
                    UnitPriceRatio    = Obj.UnitPriceRatio,
                    Unity             = Obj.Unity,
                    UploadAbleFiles   = Obj.UploadAbleFiles,
                    WholesalePrice    = Obj.WholesalePrice,
                                        #if (PRESTASHOP_VERSION_161 || PRESTASHOP_VERSION_172)
                    PackStockType = Obj.PackStockType,
                                        #endif
                });
                DBPrestashop.SubmitChanges();
            }
        }
Ejemplo n.º 5
0
        public void Add(PsAttributeGroup Obj, UInt32 IDShop)
        {
            if (Obj.Position == 0)
            {
                List <PsAttributeGroup> groups = List(IDShop);
                Obj.Position = (groups.Count == 0) ? 1 : groups.Max(result => result.Position) + 1;
            }

            this.DBPrestashop.PsAttributeGroup.InsertOnSubmit(Obj);
            this.Save();

            //Si le groupe n'existe pas dans la boutique, il est rajouté.
            if (!ExistInShop(Obj.IDAttributeGroup, IDShop))
            {
                DBPrestashop.PsAttributeGroupShop.InsertOnSubmit(new PsAttributeGroupShop()
                {
                    IDAttributeGroup = Obj.IDAttributeGroup,
                    IDShop           = IDShop,
                });
                DBPrestashop.SubmitChanges();
            }
        }
        public void Add(PsImage Obj, UInt32 IDShop)
        {
            this.DBPrestashop.PsImage.InsertOnSubmit(Obj);
            this.Save();

            //Si l'image n'existe pas dans la boutique, elle est rajoutée.
            if (!ExistInShop(Obj.IDImage, IDShop))
            {
                DBPrestashop.PsImageShop.InsertOnSubmit(new PsImageShop()
                {
                    IDImage = Obj.IDImage,
                    IDShop  = IDShop,
                                        #if (PRESTASHOP_VERSION_161 || PRESTASHOP_VERSION_172)
                    IDProduct = Obj.IDProduct,
                    Cover     = Obj.Cover,
                                        #elif (PRESTASHOP_VERSION_160)
                    Cover = (sbyte)Obj.Cover,
                                        #elif (PREStASHOP_VERSION_15)
                    Cover = Obj.Cover,
                                        #endif
                });
                DBPrestashop.SubmitChanges();
            }
        }
 public void Save()
 {
     DBPrestashop.SubmitChanges();
 }