Пример #1
0
        public static Pricing UpdatePricing(this IGenericRepository <Pricing> pricingRepository,
                                            RetailerUpdateProductDTO retailerUpdateProductDTO, Pricing pricing, string user)
        {
            try
            {
                var oldPrice = pricing.Price;

                pricing.OldPrice                = oldPrice ?? 0;
                pricing.Price                   = retailerUpdateProductDTO.NewPrice;
                pricing.SpecialPrice            = retailerUpdateProductDTO.NewSpecialPrice;
                pricing.SpecialPriceDescription = retailerUpdateProductDTO.NewSpecialPriceDescription;

                pricing.AdditionalShippingCharge     = retailerUpdateProductDTO.NewShippingCharge;
                pricing.AdditionalTax                = retailerUpdateProductDTO.NewAdditionalTax;
                pricing.SpecialPriceStartDateTimeUtc = retailerUpdateProductDTO.NewPriceStartTime;
                pricing.SpecialPriceEndDateTimeUtc   = retailerUpdateProductDTO.NewPriceEndTime;
                // pricing.IsFreeShipping = retailerUpdateProductDTO.NewIsFreeShipping;
                //  pricing.IsShipEnabled = retailerUpdateProductDTO.NewIsShipEnabled;
                pricing.DeliveryTime = retailerUpdateProductDTO.NewDeliveryTime;
                pricing.UpdatedUser  = user;
                pricingRepository.Attach(pricing);
                return(pricing);
            }
            catch
            {
                return(null);
            }
        }