public void Can_save_and_load_deliveryDate()
        {
            var deliveryDate = new DeliveryDate
                               {
                                   Name = "Name 1",
                                   DisplayOrder = 1
                               };

            var fromDb = SaveAndLoadEntity(deliveryDate);
            fromDb.ShouldNotBeNull();
            fromDb.Name.ShouldEqual("Name 1");
            fromDb.DisplayOrder.ShouldEqual(1);
        }
 protected virtual void UpdateLocales(DeliveryDate deliveryDate, DeliveryDateModel model)
 {
     foreach (var localized in model.Locales)
     {
         _localizedEntityService.SaveLocalizedValue(deliveryDate,
                                                        x => x.Name,
                                                        localized.Name,
                                                        localized.LanguageId);
     }
 }
 public static DeliveryDate ToEntity(this DeliveryDateModel model, DeliveryDate destination)
 {
     return Mapper.Map(model, destination);
 }
Beispiel #4
0
        /// <summary>
        /// Updates the delivery date
        /// </summary>
        /// <param name="deliveryDate">Delivery date</param>
        public virtual void UpdateDeliveryDate(DeliveryDate deliveryDate)
        {
            if (deliveryDate == null)
                throw new ArgumentNullException("deliveryDate");

            _deliveryDateRepository.Update(deliveryDate);

            //event notification
            _eventPublisher.EntityUpdated(deliveryDate);
        }
 protected virtual List<LocalizedProperty> UpdateLocales(DeliveryDate deliveryDate, DeliveryDateModel model)
 {
     List<LocalizedProperty> localized = new List<LocalizedProperty>();
     foreach (var local in model.Locales)
     {
         localized.Add(new LocalizedProperty()
         {
             LanguageId = local.LanguageId,
             LocaleKey = "Name",
             LocaleValue = local.Name
         });
     }
     return localized;
 }