Esempio n. 1
0
        private bool Update()
        {
            Product product = new Product(this.guid);

            DBProduct.AddHistory(
                Guid.NewGuid(),
                product.Guid,
                product.StoreGuid,
                product.TaxClassGuid,
                string.Empty,
                ConvertProductStatusToByte(product.Status),
                ConvertFulfillmentTypeToByte(product.FulfillmentType),
                product.Weight,
                product.QuantityOnHand,
                product.ImageFileName,
                product.ImageFileBytes,
                product.Created,
                product.CreatedBy,
                product.LastModified,
                product.LastModifedBy,
                DateTime.UtcNow,
                product.shippingAmount);

            bool result = DBProduct.Update(
                this.guid,
                this.taxClassGuid,
                this.modelNumber,
                this.status,
                this.fulfillmentType,
                this.weight,
                this.quantityOnHand,
                this.imageFileName,
                this.imageFileBytes,
                this.lastModified,
                this.lastModifedBy,
                this.url,
                this.name,
                this.description,
                this.teaser,
                this.showInProductList,
                this.enableRating,
                this.metaDescription,
                this.metaKeywords,
                this.sortRank1,
                this.sortRank2,
                this.teaserFile,
                this.teaserFileLink,
                this.compiledMeta,
                this.shippingAmount);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                OnContentChanged(e);
            }

            return(result);
        }
Esempio n. 2
0
        public static bool Delete(
            Guid productGuid,
            Guid userGuid,
            string userIPAddress)
        {
            Product product = new Product(productGuid);

            if (
                (product.Guid == productGuid) &&
                (productGuid != Guid.Empty)
                )
            {
                DBProduct.AddHistory(
                    Guid.NewGuid(),
                    product.Guid,
                    product.StoreGuid,
                    product.TaxClassGuid,
                    product.Sku,
                    ConvertProductStatusToByte(product.Status),
                    ConvertFulfillmentTypeToByte(product.FulfillmentType),
                    product.Weight,
                    product.QuantityOnHand,
                    product.ImageFileName,
                    product.ImageFileBytes,
                    product.Created,
                    product.CreatedBy,
                    product.LastModified,
                    product.LastModifedBy,
                    DateTime.UtcNow,
                    product.shippingAmount);

                OfferProduct.DeleteByProduct(
                    productGuid,
                    userGuid,
                    userIPAddress);
            }

            return(DBProduct.Delete(
                       productGuid,
                       DateTime.UtcNow,
                       userGuid,
                       userIPAddress));
        }