/// <summary>
        /// Updates the product manufacturer mapping
        /// </summary>
        /// <param name="productManufacturerId">Product manufacturer mapping identifier</param>
        /// <param name="productId">Product identifier</param>
        /// <param name="manufacturerId">Manufacturer identifier</param>
        /// <param name="isFeaturedProduct">A value indicating whether the product is featured</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Product manufacturer mapping </returns>
        public static ProductManufacturer UpdateProductManufacturer(int productManufacturerId,
                                                                    int productId, int manufacturerId, bool isFeaturedProduct, int displayOrder)
        {
            var dbItem = DBProviderManager <DBManufacturerProvider> .Provider.UpdateProductManufacturer(productManufacturerId,
                                                                                                        productId, manufacturerId, isFeaturedProduct, displayOrder);

            var productManufacturer = DBMapping(dbItem);

            if (ManufacturerManager.ManufacturersCacheEnabled || ManufacturerManager.MappingsCacheEnabled)
            {
                NopCache.RemoveByPattern(MANUFACTURERS_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTMANUFACTURERS_PATTERN_KEY);
            }

            return(productManufacturer);
        }
Example #2
0
        /// <summary>
        /// Updates the poll
        /// </summary>
        /// <param name="pollId">The poll identifier</param>
        /// <param name="languageId">The language identifier</param>
        /// <param name="name">The name</param>
        /// <param name="systemKeyword">The system keyword</param>
        /// <param name="published">A value indicating whether the entity is published</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Poll</returns>
        public static Poll UpdatePoll(int pollId, int languageId, string name,
                                      string systemKeyword, bool published, int displayOrder)
        {
            var dbItem = DBProviderManager <DBPollProvider> .Provider.UpdatePoll(pollId,
                                                                                 languageId, name, systemKeyword, published, displayOrder);

            var poll = DBMapping(dbItem);

            if (PollManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(POLLS_PATTERN_KEY);
                NopCache.RemoveByPattern(POLLANSWERS_PATTERN_KEY);
            }

            return(poll);
        }
Example #3
0
        /// <summary>
        /// Updates the specification attribute
        /// </summary>
        /// <param name="specificationAttributeOptionId">The specification attribute option identifier</param>
        /// <param name="specificationAttributeId">The specification attribute identifier</param>
        /// <param name="name">The name</param>
        /// <param name="displayOrder">Display order</param>
        /// <returns>Specification attribute option</returns>
        public static SpecificationAttributeOption UpdateSpecificationAttributeOptions(int specificationAttributeOptionId,
                                                                                       int specificationAttributeId, string name, int displayOrder)
        {
            var dbItem = DBProviderManager <DBSpecificationAttributeProvider> .Provider.UpdateSpecificationAttributeOption(specificationAttributeOptionId, specificationAttributeId, name, displayOrder);

            var specificationAttributeOption = DBMapping(dbItem);

            if (SpecificationAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(SPECIFICATIONATTRIBUTEOPTION_PATTERN_KEY);
                NopCache.RemoveByPattern(SPECIFICATIONATTRIBUTEOPTION_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTSPECIFICATIONATTRIBUTE_PATTERN_KEY);
            }

            return(specificationAttributeOption);
        }
        /// <summary>
        /// Inserts a localized manufacturer
        /// </summary>
        /// <param name="manufacturerId">Manufacturer identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <param name="name">Name text</param>
        /// <param name="description">Description text</param>
        /// <param name="metaKeywords">Meta keywords text</param>
        /// <param name="metaDescription">Meta descriptions text</param>
        /// <param name="metaTitle">Metat title text</param>
        /// <param name="seName">Se name text</param>
        /// <returns>Manufacturer content</returns>
        public static ManufacturerLocalized InsertManufacturerLocalized(int manufacturerId,
                                                                        int languageId, string name, string description,
                                                                        string metaKeywords, string metaDescription, string metaTitle, string seName)
        {
            var dbItem = DBProviderManager <DBManufacturerProvider> .Provider.InsertManufacturerLocalized(manufacturerId,
                                                                                                          languageId, name, description, metaKeywords, metaDescription, metaTitle, seName);

            var item = DBMapping(dbItem);

            if (ManufacturerManager.ManufacturersCacheEnabled)
            {
                NopCache.RemoveByPattern(MANUFACTURERS_PATTERN_KEY);
            }

            return(item);
        }
        /// <summary>
        /// Inserts a product specification attribute mapping
        /// </summary>
        /// <param name="productID">Product identifier</param>
        /// <param name="specificationAttributeOptionID">Specification attribute option identifier</param>
        /// <param name="allowFiltering">Allow product filtering by this attribute</param>
        /// <param name="showOnProductPage">Show the attribute on the product page</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Product specification attribute mapping</returns>
        public static ProductSpecificationAttribute InsertProductSpecificationAttribute(int productID, int specificationAttributeOptionID,
                                                                                        bool allowFiltering, bool showOnProductPage, int displayOrder)
        {
            DBProductSpecificationAttribute dbItem = DBProviderManager <DBSpecificationAttributeProvider> .Provider.InsertProductSpecificationAttribute(productID,
                                                                                                                                                        specificationAttributeOptionID, allowFiltering, showOnProductPage, displayOrder);

            ProductSpecificationAttribute productSpecificationAttribute = DBMapping(dbItem);

            if (SpecificationAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(SPECIFICATIONATTRIBUTEOPTION_PATTERN_KEY);
                NopCache.RemoveByPattern(SPECIFICATIONATTRIBUTEOPTION_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTSPECIFICATIONATTRIBUTE_PATTERN_KEY);
            }
            return(productSpecificationAttribute);
        }
Example #6
0
        /// <summary>
        /// Updates the poll answer
        /// </summary>
        /// <param name="pollAnswerId">The poll answer identifier</param>
        /// <param name="pollId">The poll identifier</param>
        /// <param name="name">The poll answer name</param>
        /// <param name="count">The current count</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Poll answer</returns>
        public static PollAnswer UpdatePoll(int pollAnswerId,
                                            int pollId, string name, int count, int displayOrder)
        {
            var dbItem = DBProviderManager <DBPollProvider> .Provider.UpdatePollAnswer(pollAnswerId,
                                                                                       pollId, name, count, displayOrder);

            var pollAnswer = DBMapping(dbItem);

            if (PollManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(POLLS_PATTERN_KEY);
                NopCache.RemoveByPattern(POLLANSWERS_PATTERN_KEY);
            }

            return(pollAnswer);
        }
        /// <summary>
        /// Updates the shipping rate computation method
        /// </summary>
        /// <param name="shippingRateComputationMethodId">The shipping rate computation method identifier</param>
        /// <param name="name">The name</param>
        /// <param name="description">The description</param>
        /// <param name="configureTemplatePath">The configure template path</param>
        /// <param name="className">The class name</param>
        /// <param name="isActive">The value indicating whether the method is active</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Shipping rate computation method</returns>
        public static ShippingRateComputationMethod UpdateShippingRateComputationMethod(int shippingRateComputationMethodId,
                                                                                        string name, string description, string configureTemplatePath, string className,
                                                                                        bool isActive, int displayOrder)
        {
            var dbItem = DBProviderManager <DBShippingRateComputationMethodProvider> .Provider.UpdateShippingRateComputationMethod(shippingRateComputationMethodId,
                                                                                                                                   name, description, configureTemplatePath, className,
                                                                                                                                   isActive, displayOrder);

            var shippingRateComputationMethod = DBMapping(dbItem);

            if (ShippingRateComputationMethodManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(SHIPPINGRATECOMPUTATIONMETHODS_PATTERN_KEY);
            }
            return(shippingRateComputationMethod);
        }
        /// <summary>
        /// Updates a language
        /// </summary>
        /// <param name="languageId">Language identifier</param>
        /// <param name="name">The name</param>
        /// <param name="languageCulture">The language culture</param>
        /// <param name="flagImageFileName">The flag image file name</param>
        /// <param name="published">A value indicating whether the language is published</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Language</returns>
        public static Language UpdateLanguage(int languageId,
                                              string name, string languageCulture,
                                              string flagImageFileName, bool published, int displayOrder)
        {
            var dbItem = DBProviderManager <DBLanguageProvider> .Provider.UpdateLanguage(languageId,
                                                                                         name, languageCulture, flagImageFileName, published, displayOrder);

            var language = DBMapping(dbItem);

            if (LanguageManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(LANGUAGES_PATTERN_KEY);
            }

            return(language);
        }
Example #9
0
        /// <summary>
        /// Update a localized product variant attribute value
        /// </summary>
        /// <param name="productVariantAttributeValueLocalizedId">Localized product variant attribute value identifier</param>
        /// <param name="productVariantAttributeValueId">Product variant attribute value identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <param name="name">Name text</param>
        /// <returns>Localized product variant attribute value</returns>
        public static ProductVariantAttributeValueLocalized UpdateProductVariantAttributeValueLocalized(int productVariantAttributeValueLocalizedId,
                                                                                                        int productVariantAttributeValueId, int languageId, string name)
        {
            var dbItem = DBProviderManager <DBProductAttributeProvider> .Provider.UpdateProductVariantAttributeValueLocalized(productVariantAttributeValueLocalizedId,
                                                                                                                              productVariantAttributeValueId, languageId, name);

            var item = DBMapping(dbItem);

            if (ProductAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(PRODUCTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTEVALUES_PATTERN_KEY);
            }

            return(item);
        }
        /// <summary>
        /// Updates the product variant attribute mapping
        /// </summary>
        /// <param name="ProductVariantAttributeID">The product variant attribute mapping identifier</param>
        /// <param name="ProductVariantID">The product variant identifier</param>
        /// <param name="ProductAttributeID">The product attribute identifier</param>
        /// <param name="TextPrompt">The text prompt</param>
        /// <param name="IsRequired">The value indicating whether the entity is required</param>
        /// <param name="AttributeControlType">The attribute control type</param>
        /// <param name="DisplayOrder">The display order</param>
        /// <returns>Product variant attribute mapping</returns>
        public static ProductVariantAttribute UpdateProductVariantAttribute(int ProductVariantAttributeID, int ProductVariantID,
                                                                            int ProductAttributeID, string TextPrompt, bool IsRequired, AttributeControlTypeEnum AttributeControlType, int DisplayOrder)
        {
            DBProductVariantAttribute dbItem = DBProviderManager <DBProductAttributeProvider> .Provider.UpdateProductVariantAttribute(ProductVariantAttributeID,
                                                                                                                                      ProductVariantID, ProductAttributeID, TextPrompt, IsRequired, (int)AttributeControlType, DisplayOrder);

            ProductVariantAttribute productVariantAttribute = DBMapping(dbItem);

            if (ProductAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(PRODUCTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTEVALUES_PATTERN_KEY);
            }

            return(productVariantAttribute);
        }
        /// <summary>
        /// Updates the product attribute
        /// </summary>
        /// <param name="ProductAttributeID">Product attribute identifier</param>
        /// <param name="Name">The name</param>
        /// <param name="Description">The description</param>
        /// <returns>Product attribute </returns>
        public static ProductAttribute UpdateProductAttribute(int ProductAttributeID, string Name,
                                                              string Description)
        {
            DBProductAttribute dbItem = DBProviderManager <DBProductAttributeProvider> .Provider.UpdateProductAttribute(ProductAttributeID,
                                                                                                                        Name, Description);

            ProductAttribute productAttribute = DBMapping(dbItem);

            if (ProductAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(PRODUCTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTEVALUES_PATTERN_KEY);
            }

            return(productAttribute);
        }
Example #12
0
        /// <summary>
        /// Updates the tax category
        /// </summary>
        /// <param name="TaxCategoryID">The tax category identifier</param>
        /// <param name="Name">The name</param>
        /// <param name="DisplayOrder">The display order</param>
        /// <param name="CreatedOn">The date and time of instance creation</param>
        /// <param name="UpdatedOn">The date and time of instance update</param>
        /// <returns>Tax category</returns>
        public static TaxCategory UpdateTaxCategory(int TaxCategoryID, string Name,
                                                    int DisplayOrder, DateTime CreatedOn, DateTime UpdatedOn)
        {
            CreatedOn = DateTimeHelper.ConvertToUtcTime(CreatedOn);
            UpdatedOn = DateTimeHelper.ConvertToUtcTime(UpdatedOn);

            DBTaxCategory dbItem = DBProviderManager <DBTaxCategoryProvider> .Provider.UpdateTaxCategory(TaxCategoryID, Name,
                                                                                                         DisplayOrder, CreatedOn, UpdatedOn);

            TaxCategory taxCategory = DBMapping(dbItem);

            if (TaxCategoryManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(TAXCATEGORIES_PATTERN_KEY);
            }
            return(taxCategory);
        }
Example #13
0
        /// <summary>
        /// Inserts a product variant attribute mapping
        /// </summary>
        /// <param name="productVariantId">The product variant identifier</param>
        /// <param name="productAttributeId">The product attribute identifier</param>
        /// <param name="textPrompt">The text prompt</param>
        /// <param name="isRequired">The value indicating whether the entity is required</param>
        /// <param name="attributeControlType">The attribute control type</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Product variant attribute mapping</returns>
        public static ProductVariantAttribute InsertProductVariantAttribute(int productVariantId,
                                                                            int productAttributeId, string textPrompt, bool isRequired, AttributeControlTypeEnum attributeControlType, int displayOrder)
        {
            var dbItem = DBProviderManager <DBProductAttributeProvider> .Provider.InsertProductVariantAttribute(productVariantId,
                                                                                                                productAttributeId, textPrompt, isRequired, (int)attributeControlType, displayOrder);

            var productVariantAttribute = DBMapping(dbItem);

            if (ProductAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(PRODUCTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTEVALUES_PATTERN_KEY);
            }

            return(productVariantAttribute);
        }
Example #14
0
        /// <summary>
        /// Inserts a localized product attribute
        /// </summary>
        /// <param name="productAttributeId">Product attribute identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <param name="name">Name text</param>
        /// <param name="description">Description text</param>
        /// <returns>Product attribute content</returns>
        public static ProductAttributeLocalized InsertProductAttributeLocalized(int productAttributeId,
                                                                                int languageId, string name, string description)
        {
            var dbItem = DBProviderManager <DBProductAttributeProvider> .Provider.InsertProductAttributeLocalized(productAttributeId,
                                                                                                                  languageId, name, description);

            var item = DBMapping(dbItem);

            if (ProductAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(PRODUCTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTVARIANTATTRIBUTEVALUES_PATTERN_KEY);
            }

            return(item);
        }
        /// <summary>
        /// Updates the tax category
        /// </summary>
        /// <param name="taxCategoryId">The tax category identifier</param>
        /// <param name="name">The name</param>
        /// <param name="displayOrder">The display order</param>
        /// <param name="createdOn">The date and time of instance creation</param>
        /// <param name="updatedOn">The date and time of instance update</param>
        /// <returns>Tax category</returns>
        public static TaxCategory UpdateTaxCategory(int taxCategoryId, string name,
                                                    int displayOrder, DateTime createdOn, DateTime updatedOn)
        {
            createdOn = DateTimeHelper.ConvertToUtcTime(createdOn);
            updatedOn = DateTimeHelper.ConvertToUtcTime(updatedOn);

            var dbItem = DBProviderManager <DBTaxCategoryProvider> .Provider.UpdateTaxCategory(taxCategoryId, name,
                                                                                               displayOrder, createdOn, updatedOn);

            var taxCategory = DBMapping(dbItem);

            if (TaxCategoryManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(TAXCATEGORIES_PATTERN_KEY);
            }
            return(taxCategory);
        }
Example #16
0
        /// <summary>
        /// Inserts a news item
        /// </summary>
        /// <param name="languageId">The language identifier</param>
        /// <param name="title">The news title</param>
        /// <param name="shortText">The short text</param>
        /// <param name="fullText">The full text</param>
        /// <param name="published">A value indicating whether the entity is published</param>
        /// <param name="allowComments">A value indicating whether the entity allows comments</param>
        /// <param name="createdOn">The date and time of instance creation</param>
        /// <returns>News item</returns>
        public static News InsertNews(int languageId, string title, string shortText,
                                      string fullText, bool published, bool allowComments, DateTime createdOn)
        {
            createdOn = DateTimeHelper.ConvertToUtcTime(createdOn);

            var dbItem = DBProviderManager <DBNewsProvider> .Provider.InsertNews(languageId,
                                                                                 title, shortText, fullText, published, allowComments, createdOn);

            var news = DBMapping(dbItem);

            if (NewsManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(NEWS_PATTERN_KEY);
            }

            return(news);
        }
Example #17
0
        /// <summary>
        /// Update a localized specification attribute option
        /// </summary>
        /// <param name="specificationAttributeOptionLocalizedId">Localized specification attribute option identifier</param>
        /// <param name="specificationAttributeOptionId">Specification attribute option identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <param name="name">Name text</param>
        /// <returns>Localized specification attribute option</returns>
        public static SpecificationAttributeOptionLocalized UpdateSpecificationAttributeOptionLocalized(int specificationAttributeOptionLocalizedId,
                                                                                                        int specificationAttributeOptionId, int languageId, string name)
        {
            var dbItem = DBProviderManager <DBSpecificationAttributeProvider> .Provider.UpdateSpecificationAttributeOptionLocalized(specificationAttributeOptionLocalizedId,
                                                                                                                                    specificationAttributeOptionId, languageId, name);

            var item = DBMapping(dbItem);

            if (SpecificationAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(SPECIFICATIONATTRIBUTE_PATTERN_KEY);
                NopCache.RemoveByPattern(SPECIFICATIONATTRIBUTEOPTION_PATTERN_KEY);
                NopCache.RemoveByPattern(PRODUCTSPECIFICATIONATTRIBUTE_PATTERN_KEY);
            }

            return(item);
        }
Example #18
0
        /// <summary>
        /// Updates an IP address
        /// </summary>
        /// <param name="ipAddressId">IP address unique identifier</param>
        /// <param name="address">IP address</param>
        /// <param name="comment">Reason why the IP was banned</param>
        /// <param name="createdOn">When the record was inserted</param>
        /// <param name="updatedOn">When the record was last updated</param>
        /// <returns>IP address</returns>
        public static BannedIpAddress UpdateBannedIpAddress(int ipAddressId, string address, string comment, DateTime createdOn, DateTime updatedOn)
        {
            createdOn = DateTimeHelper.ConvertToUtcTime(createdOn);
            updatedOn = DateTimeHelper.ConvertToUtcTime(updatedOn);

            address = address.Trim();

            var dbItem = DBProviderManager <DBBlacklistProvider> .Provider.UpdateBannedIpAddress(ipAddressId, address, comment, createdOn, updatedOn);

            var ipAddress = DBMapping(dbItem);

            if (IpBlacklistManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(BLACKLIST_IP_PATTERN_KEY);
            }
            return(ipAddress);
        }
        /// <summary>
        /// Updates the manufacturer template
        /// </summary>
        /// <param name="ManufacturerTemplateID">Manufacturer template identifer</param>
        /// <param name="Name">The manufacturer template identifier</param>
        /// <param name="TemplatePath">The template path</param>
        /// <param name="DisplayOrder">The display order</param>
        /// <param name="CreatedOn">The date and time of instance creation</param>
        /// <param name="UpdatedOn">The date and time of instance update</param>
        /// <returns>Manufacturer template</returns>
        public static ManufacturerTemplate UpdateManufacturerTemplate(int ManufacturerTemplateID, string Name, string TemplatePath,
                                                                      int DisplayOrder, DateTime CreatedOn, DateTime UpdatedOn)
        {
            CreatedOn = DateTimeHelper.ConvertToUtcTime(CreatedOn);
            UpdatedOn = DateTimeHelper.ConvertToUtcTime(UpdatedOn);

            DBManufacturerTemplate dbItem = DBProviderManager <DBTemplateProvider> .Provider.UpdateManufacturerTemplate(ManufacturerTemplateID,
                                                                                                                        Name, TemplatePath, DisplayOrder, CreatedOn, UpdatedOn);

            ManufacturerTemplate manufacturerTemplate = DBMapping(dbItem);

            if (TemplateManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(MANUFACTURERTEMPLATES_PATTERN_KEY);
            }
            return(manufacturerTemplate);
        }
Example #20
0
        /// <summary>
        /// Inserts a manufacturer template
        /// </summary>
        /// <param name="name">The manufacturer template identifier</param>
        /// <param name="templatePath">The template path</param>
        /// <param name="displayOrder">The display order</param>
        /// <param name="createdOn">The date and time of instance creation</param>
        /// <param name="updatedOn">The date and time of instance update</param>
        /// <returns>Manufacturer template</returns>
        public static ManufacturerTemplate InsertManufacturerTemplate(string name,
                                                                      string templatePath, int displayOrder, DateTime createdOn, DateTime updatedOn)
        {
            createdOn = DateTimeHelper.ConvertToUtcTime(createdOn);
            updatedOn = DateTimeHelper.ConvertToUtcTime(updatedOn);

            var dbItem = DBProviderManager <DBTemplateProvider> .Provider.InsertManufacturerTemplate(name,
                                                                                                     templatePath, displayOrder, createdOn, updatedOn);

            var manufacturerTemplate = DBMapping(dbItem);

            if (TemplateManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(MANUFACTURERTEMPLATES_PATTERN_KEY);
            }
            return(manufacturerTemplate);
        }
Example #21
0
        /// <summary>
        /// Updates the blog post
        /// </summary>
        /// <param name="LanguageID">The language identifier</param>
        /// <param name="BlogPostID">Blog post identifier</param>
        /// <param name="BlogPostTitle">The blog post title</param>
        /// <param name="BlogPostBody">The blog post title</param>
        /// <param name="BlogPostAllowComments">A value indicating whether the blog post comments are allowed</param>
        /// <param name="CreatedByID">The user identifier who created the blog post</param>
        /// <param name="CreatedOn">The date and time of instance creation</param>
        /// <returns>Blog post</returns>
        public static BlogPost UpdateBlogPost(int BlogPostID, int LanguageID, string BlogPostTitle, string BlogPostBody,
                                              bool BlogPostAllowComments, int CreatedByID, DateTime CreatedOn)
        {
            CreatedOn = DateTimeHelper.ConvertToUtcTime(CreatedOn);

            DBBlogPost dbItem = DBProviderManager <DBBlogProvider> .Provider.UpdateBlogPost(BlogPostID, LanguageID, BlogPostTitle, BlogPostBody,
                                                                                            BlogPostAllowComments, CreatedByID, CreatedOn);

            BlogPost blogPost = DBMapping(dbItem);

            if (BlogManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(BLOGPOST_PATTERN_KEY);
            }

            return(blogPost);
        }
Example #22
0
        /// <summary>
        /// Updates the news item
        /// </summary>
        /// <param name="NewsID">The news identifier</param>
        /// <param name="LanguageID">The language identifier</param>
        /// <param name="Title">The news title</param>
        /// <param name="Short">The short text</param>
        /// <param name="Full">The full text</param>
        /// <param name="Published">A value indicating whether the entity is published</param>
        /// <param name="AllowComments">A value indicating whether the entity allows comments</param>
        /// <param name="CreatedOn">The date and time of instance creation</param>
        /// <returns>News item</returns>
        public static News UpdateNews(int NewsID, int LanguageID, string Title, string Short,
                                      string Full, bool Published, bool AllowComments, DateTime CreatedOn)
        {
            CreatedOn = DateTimeHelper.ConvertToUtcTime(CreatedOn);

            DBNews dbItem = DBProviderManager <DBNewsProvider> .Provider.UpdateNews(NewsID, LanguageID, Title, Short,
                                                                                    Full, Published, AllowComments, CreatedOn);

            News news = DBMapping(dbItem);

            if (NewsManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(NEWS_PATTERN_KEY);
            }

            return(news);
        }
Example #23
0
        /// <summary>
        /// Updates the payment method
        /// </summary>
        /// <param name="paymentMethodId">The payment method identifer</param>
        /// <param name="name">The name</param>
        /// <param name="visibleName">The visible name</param>
        /// <param name="description">The description</param>
        /// <param name="configureTemplatePath">The configure template path</param>
        /// <param name="userTemplatePath">The user template path</param>
        /// <param name="className">The class name</param>
        /// <param name="systemKeyword">The system keyword</param>
        /// <param name="isActive">A value indicating whether the payment method is active</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Payment method</returns>
        public static PaymentMethod UpdatePaymentMethod(int paymentMethodId,
                                                        string name, string visibleName, string description, string configureTemplatePath,
                                                        string userTemplatePath, string className, string systemKeyword,
                                                        bool isActive, int displayOrder)
        {
            var dbItem = DBProviderManager <DBPaymentMethodProvider> .Provider.UpdatePaymentMethod(paymentMethodId,
                                                                                                   name, visibleName, description, configureTemplatePath, userTemplatePath,
                                                                                                   className, systemKeyword, isActive, displayOrder);

            var paymentMethod = DBMapping(dbItem);

            if (PaymentMethodManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(PAYMENTMETHODS_PATTERN_KEY);
            }
            return(paymentMethod);
        }
        /// <summary>
        /// Updates the checkout attribute value
        /// </summary>
        /// <param name="checkoutAttributeValueId">The checkout attribute value identifier</param>
        /// <param name="checkoutAttributeId">The checkout attribute identifier</param>
        /// <param name="name">The checkout attribute name</param>
        /// <param name="priceAdjustment">The price adjustment</param>
        /// <param name="weightAdjustment">The weight adjustment</param>
        /// <param name="isPreSelected">The value indicating whether the value is pre-selected</param>
        /// <param name="displayOrder">The display order</param>
        /// <returns>Checkout attribute value</returns>
        public static CheckoutAttributeValue UpdateCheckoutAttributeValue(int checkoutAttributeValueId,
                                                                          int checkoutAttributeId, string name, decimal priceAdjustment, decimal weightAdjustment,
                                                                          bool isPreSelected, int displayOrder)
        {
            var dbItem = DBProviderManager <DBCheckoutAttributeProvider> .Provider.UpdateCheckoutAttributeValue(checkoutAttributeValueId,
                                                                                                                checkoutAttributeId, name, priceAdjustment, weightAdjustment, isPreSelected, displayOrder);

            var checkoutAttributeValue = DBMapping(dbItem);

            if (CheckoutAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(CHECKOUTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(CHECKOUTATTRIBUTEVALUES_PATTERN_KEY);
            }

            return(checkoutAttributeValue);
        }
        /// <summary>
        /// Inserts a country
        /// </summary>
        /// <param name="Name">The name</param>
        /// <param name="AllowsRegistration">A value indicating whether registration is allowed to this country</param>
        /// <param name="AllowsBilling">A value indicating whether billing is allowed to this country</param>
        /// <param name="AllowsShipping">A value indicating whether shipping is allowed to this country</param>
        /// <param name="TwoLetterISOCode">The two letter ISO code</param>
        /// <param name="ThreeLetterISOCode">The three letter ISO code</param>
        /// <param name="NumericISOCode">The numeric ISO code</param>
        /// <param name="Published">A value indicating whether the entity is published</param>
        /// <param name="DisplayOrder">The display order</param>
        /// <returns>Country</returns>
        public static Country InsertCountry(string Name,
                                            bool AllowsRegistration, bool AllowsBilling, bool AllowsShipping,
                                            string TwoLetterISOCode, string ThreeLetterISOCode, int NumericISOCode,
                                            bool Published, int DisplayOrder)
        {
            DBCountry dbItem = DBProviderManager <DBCountryProvider> .Provider.InsertCountry(Name,
                                                                                             AllowsRegistration, AllowsBilling, AllowsShipping,
                                                                                             TwoLetterISOCode, ThreeLetterISOCode, NumericISOCode, Published,
                                                                                             DisplayOrder);

            Country country = DBMapping(dbItem);

            if (CountryManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(COUNTRIES_PATTERN_KEY);
            }
            return(country);
        }
Example #26
0
        /// <summary>
        /// Update a localized category
        /// </summary>
        /// <param name="categoryLocalizedId">Localized category identifier</param>
        /// <param name="categoryId">Category identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <param name="name">Name text</param>
        /// <param name="description">Description text</param>
        /// <param name="metaKeywords">Meta keywords text</param>
        /// <param name="metaDescription">Meta descriptions text</param>
        /// <param name="metaTitle">Metat title text</param>
        /// <param name="seName">Se Name text</param>
        /// <returns>Category content</returns>
        public static CategoryLocalized UpdateCategoryLocalized(int categoryLocalizedId,
                                                                int categoryId, int languageId, string name, string description,
                                                                string metaKeywords, string metaDescription, string metaTitle,
                                                                string seName)
        {
            var dbItem = DBProviderManager <DBCategoryProvider> .Provider.UpdateCategoryLocalized(categoryLocalizedId,
                                                                                                  categoryId, languageId, name, description, metaKeywords,
                                                                                                  metaDescription, metaTitle, seName);

            var item = DBMapping(dbItem);

            if (CategoryManager.CategoriesCacheEnabled)
            {
                NopCache.RemoveByPattern(CATEGORIES_PATTERN_KEY);
            }

            return(item);
        }
        /// <summary>
        /// Inserts a checkout attribute
        /// </summary>
        /// <param name="name">Name</param>
        /// <param name="textPrompt">Text prompt</param>
        /// <param name="isRequired">Value indicating whether the entity is required</param>
        /// <param name="shippableProductRequired">Value indicating whether shippable products are required in order to display this attribute</param>
        /// <param name="isTaxExempt">Value indicating whether the attribute is marked as tax exempt</param>
        /// <param name="taxCategoryId">Tax category identifier</param>
        /// <param name="attributeControlTypeId">Attribute control type identifier</param>
        /// <param name="displayOrder">Display order</param>
        /// <returns>Checkout attribute</returns>
        public static CheckoutAttribute InsertCheckoutAttribute(string name,
                                                                string textPrompt, bool isRequired, bool shippableProductRequired,
                                                                bool isTaxExempt, int taxCategoryId, int attributeControlTypeId,
                                                                int displayOrder)
        {
            var dbItem = DBProviderManager <DBCheckoutAttributeProvider> .Provider.InsertCheckoutAttribute(name,
                                                                                                           textPrompt, isRequired, shippableProductRequired,
                                                                                                           isTaxExempt, taxCategoryId, attributeControlTypeId, displayOrder);

            var checkoutAttribute = DBMapping(dbItem);

            if (CheckoutAttributeManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(CHECKOUTATTRIBUTES_PATTERN_KEY);
                NopCache.RemoveByPattern(CHECKOUTATTRIBUTEVALUES_PATTERN_KEY);
            }
            return(checkoutAttribute);
        }
        /// <summary>
        /// Inserts a category template
        /// </summary>
        /// <param name="Name">The name</param>
        /// <param name="TemplatePath">The template path</param>
        /// <param name="DisplayOrder">The display order</param>
        /// <param name="CreatedOn">The date and time of instance creation</param>
        /// <param name="UpdatedOn">The date and time of instance update</param>
        /// <returns>A category template</returns>
        public static CategoryTemplate InsertCategoryTemplate(string Name, string TemplatePath,
                                                              int DisplayOrder, DateTime CreatedOn, DateTime UpdatedOn)
        {
            CreatedOn = DateTimeHelper.ConvertToUtcTime(CreatedOn);
            UpdatedOn = DateTimeHelper.ConvertToUtcTime(UpdatedOn);

            DBCategoryTemplate dbItem = DBProviderManager <DBTemplateProvider> .Provider.InsertCategoryTemplate(Name, TemplatePath,
                                                                                                                DisplayOrder, CreatedOn, UpdatedOn);

            CategoryTemplate categoryTemplate = DBMapping(dbItem);

            if (TemplateManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(CATEGORYTEMPLATES_PATTERN_KEY);
            }

            return(categoryTemplate);
        }
        /// <summary>
        /// Updates the product template
        /// </summary>
        /// <param name="ProductTemplateID">The product template identifier</param>
        /// <param name="Name">The name</param>
        /// <param name="TemplatePath">The template path</param>
        /// <param name="DisplayOrder">The display order</param>
        /// <param name="CreatedOn">The date and time of instance creation</param>
        /// <param name="UpdatedOn">The date and time of instance update</param>
        /// <returns>Product template</returns>
        public static ProductTemplate UpdateProductTemplate(int ProductTemplateID, string Name, string TemplatePath,
                                                            int DisplayOrder, DateTime CreatedOn, DateTime UpdatedOn)
        {
            CreatedOn = DateTimeHelper.ConvertToUtcTime(CreatedOn);
            UpdatedOn = DateTimeHelper.ConvertToUtcTime(UpdatedOn);

            DBProductTemplate dbItem = DBProviderManager <DBTemplateProvider> .Provider.UpdateProductTemplate(ProductTemplateID,
                                                                                                              Name, TemplatePath, DisplayOrder, CreatedOn, UpdatedOn);

            ProductTemplate productTemplate = DBMapping(dbItem);

            if (TemplateManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(PRODUCTTEMPLATES_PATTERN_KEY);
            }

            return(productTemplate);
        }
Example #30
0
        /// <summary>
        /// Updates an IP network
        /// </summary>
        /// <param name="bannedIpNetwork">IP network unique identifier</param>
        /// <param name="startAddress">First IP address in the range</param>
        /// <param name="endAddress">Last IP address in the range</param>
        /// <param name="comment">Reason why the IP network was banned</param>
        /// <param name="ipException">Exception IPs in the range</param>
        /// <param name="createdOn">When the record was created</param>
        /// <param name="updatedOn">When the record was last updated</param>
        /// <returns></returns>
        public static BannedIpNetwork UpdateBannedIpNetwork(int bannedIpNetwork, string startAddress, string endAddress, string comment, string ipException, DateTime createdOn, DateTime updatedOn)
        {
            createdOn = DateTimeHelper.ConvertToUtcTime(createdOn);
            updatedOn = DateTimeHelper.ConvertToUtcTime(updatedOn);

            startAddress = startAddress.Trim();
            endAddress   = endAddress.Trim();

            var dbItem = DBProviderManager <DBBlacklistProvider> .Provider.UpdateBannedIpNetwork(bannedIpNetwork, startAddress, endAddress, comment, ipException, createdOn, updatedOn);

            var ipNetwork = DBMapping(dbItem);

            if (IpBlacklistManager.CacheEnabled)
            {
                NopCache.RemoveByPattern(BLACKLIST_NETWORK_PATTERN_KEY);
            }
            return(ipNetwork);
        }