Esempio n. 1
0
        public static int CreateSueetieProduct(SueetieProduct sueetieProduct)
        {
            int num = CommerceDataProvider.LoadProvider().CreateSueetieProduct(sueetieProduct);

            CommerceCommon.ClearMarketplaceCache();
            return(num);
        }
Esempio n. 2
0
        /// <summary>
        /// Insert a photo as product pictures.
        /// </summary>
        /// <remarks>
        /// This method is called directly by UI using ASP.NET ObjectDataSource.
        /// </remarks>
        public static int InsertPhoto(int productID, byte[] bytesFull, byte[] bytesMedium, byte[] bytesSmall, bool useAsPreview)
        {
            int photoId = -1;

            if (bytesFull != null && bytesMedium != null && bytesSmall != null)
            {
                var productPhoto = new ProductPhoto
                {
                    ProductID     = productID,
                    IsMainPreview = useAsPreview
                };

                photoId = AddPhoto(productPhoto);

                string fullSizePath   = ImageHelper.GetFilePath(photoId, false, SueetiePhotoSize.Full, SueetiePhotoType.ProductPhoto);
                string mediumSizePath = ImageHelper.GetFilePath(photoId, false, SueetiePhotoSize.Medium, SueetiePhotoType.ProductPhoto);
                string smallSizePath  = ImageHelper.GetFilePath(photoId, false, SueetiePhotoSize.Small, SueetiePhotoType.ProductPhoto);

                ImageHelper.WriteToFile(fullSizePath, bytesFull);
                ImageHelper.WriteToFile(mediumSizePath, bytesMedium);
                ImageHelper.WriteToFile(smallSizePath, bytesSmall);

                CommerceCommon.ClearMarketplaceCache();
            }

            return(photoId);
        }
Esempio n. 3
0
        public static void SetAdPreviewPhoto(int productID, int photoID)
        {
            CommerceDataProvider provider     = CommerceDataProvider.LoadProvider();
            ProductPhoto         productPhoto = new ProductPhoto
            {
                PhotoID   = photoID,
                ProductID = productID
            };

            provider.SetPreviewPhoto(productPhoto);
            CommerceCommon.ClearMarketplaceCache();
        }
Esempio n. 4
0
        private void Load()
        {
            Type             type = base.GetType();
            StringDictionary commerceSettingsDictionary = CommerceCommon.GetCommerceSettingsDictionary();

            foreach (string str in commerceSettingsDictionary.Keys)
            {
                string str2 = str;
                string str3 = commerceSettingsDictionary[str];
                foreach (PropertyInfo info in type.GetProperties())
                {
                    if (info.Name.Equals(str2, StringComparison.OrdinalIgnoreCase))
                    {
                        if (info.CanWrite)
                        {
                            info.SetValue(this, Convert.ChangeType(str3, info.PropertyType, CultureInfo.CurrentCulture), null);
                        }
                    }
                }
            }
        }
Esempio n. 5
0
 public static void UpdateSueetieProduct(SueetieProduct sueetieProduct)
 {
     CommerceDataProvider.LoadProvider().UpdateSueetieProduct(sueetieProduct);
     CommerceCommon.ClearMarketplaceCache();
 }
Esempio n. 6
0
 public static void UpdateProductCategory(int _productID, int _categoryID)
 {
     CommerceDataProvider.LoadProvider().UpdateProductCategory(_productID, _categoryID);
     CommerceCommon.ClearMarketplaceCache();
 }
Esempio n. 7
0
 public static void MoveProductsToCategory(int currentCategoryID, int newCategoryID)
 {
     CommerceDataProvider.LoadProvider().MoveProductsToCategory(currentCategoryID, newCategoryID);
     CommerceCommon.ClearMarketplaceCache();
 }