public void UpdateLocales(DeliveryTime deliveryTime, DeliveryTimeModel model) { foreach (var localized in model.Locales) { _localizedEntityService.SaveLocalizedValue(deliveryTime, x => x.Name, localized.Name, localized.LanguageId); } }
/// <summary> /// Deletes DeliveryTime /// </summary> /// <param name="currency">DeliveryTime</param> public virtual void DeleteDeliveryTime(DeliveryTime deliveryTime) { if (deliveryTime == null) throw new ArgumentNullException("deliveryTime"); if (this.IsAssociated(deliveryTime.Id)) throw new SmartException("The delivery time cannot be deleted. It has associated product variants"); _deliveryTimeRepository.Delete(deliveryTime); _cacheManager.RemoveByPattern(DELIVERYTIMES_PATTERN_KEY); //event notification _eventPublisher.EntityDeleted(deliveryTime); }
public static DeliveryTime ToEntity(this DeliveryTimeModel model, DeliveryTime destination) { return Mapper.Map(model, destination); }
/// <summary> /// Updates the DeliveryTime /// </summary> /// <param name="deliveryTime">DeliveryTime</param> public virtual void UpdateDeliveryTime(DeliveryTime deliveryTime) { if (deliveryTime == null) throw new ArgumentNullException("deliveryTime"); _deliveryTimeRepository.Update(deliveryTime); _cacheManager.RemoveByPattern(DELIVERYTIMES_PATTERN_KEY); //event notification _eventPublisher.EntityUpdated(deliveryTime); }