Esempio n. 1
0
        public PrintOrderItemTrackingViewData Create(MarketingPrintOrderItemEntity itemEntity, string assignedByName,
                                                     string assignedForName, string assignedVendor, PrintOrderItemTrackingEntity trackingEntity)
        {
            var printOrderItemTrackingViewData = new PrintOrderItemTrackingViewData();

            printOrderItemTrackingViewData.DraftedDate = itemEntity.DateCreated.ToString("MMM dd yyyy  @ hh:mm tt");
            printOrderItemTrackingViewData.DraftedBy   = assignedByName;
            printOrderItemTrackingViewData.DraftedFor  = assignedForName;

            if (trackingEntity != null)
            {
                printOrderItemTrackingViewData.ShippedBy   = assignedVendor;
                printOrderItemTrackingViewData.Status      = (ItemStatus)itemEntity.Status;
                printOrderItemTrackingViewData.TrackingNo  = trackingEntity.TrackingNumber;
                printOrderItemTrackingViewData.ShippedVia  = trackingEntity.ShippingService;
                printOrderItemTrackingViewData.ShippedDate = trackingEntity.DateCreated.ToString("MMM dd yyyy  @ hh:mm tt");

                if (itemEntity.Status == (long)ItemStatus.Confirmed)
                {
                    printOrderItemTrackingViewData.AcknowledgeBy       = trackingEntity.ConfirmedBy;
                    printOrderItemTrackingViewData.AcknowledgementDate = ((DateTime)trackingEntity.ActualDeliveryDate).ToString("MMM dd yyyy  @ hh:mm tt");
                    printOrderItemTrackingViewData.AcknowledgeVia      = ((ItemConfirmationMode)trackingEntity.ConfirmationMode).ToString();
                }
            }


            return(printOrderItemTrackingViewData);
        }
 /// <summary> setups the sync logic for member _marketingPrintOrderItem</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncMarketingPrintOrderItem(IEntity2 relatedEntity)
 {
     if (_marketingPrintOrderItem != relatedEntity)
     {
         DesetupSyncMarketingPrintOrderItem(true, true);
         _marketingPrintOrderItem = (MarketingPrintOrderItemEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity(_marketingPrintOrderItem, new PropertyChangedEventHandler(OnMarketingPrintOrderItemPropertyChanged), "MarketingPrintOrderItem", MarketingPrintOrderProspectListMappingEntity.Relations.MarketingPrintOrderItemEntityUsingMarketingPrintOrderItemId, true, new string[] {  });
     }
 }
        /// <summary> Initializes the class members</summary>
        protected virtual void InitClassMembers()
        {
            _marketingPrintOrderItem = null;
            _prospectListDetails     = null;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
Esempio n. 4
0
 public PrintOrderItem CreatePrintOrderItem(MarketingPrintOrderItemEntity printOrderItemEntity)
 {
     return(new PrintOrderItem(printOrderItemEntity.MarketingPrintOrderItemId)
     {
         SourceCode = RemoveSourceCodeIdFromPrintOrderItemEntity(printOrderItemEntity.Sourcecode),
         Quantity = printOrderItemEntity.Quantity != null ? (long)printOrderItemEntity.Quantity : 0,
         TrackingInfo =
             printOrderItemEntity.PrintOrderItemTracking.Select(poit => _mapper.Map(poit)).
             SingleOrDefault(),
         Status = (ItemStatus)printOrderItemEntity.Status
     });
 }
Esempio n. 5
0
        public bool UpdatePrintOrderItemStatus(long printOrderItemId, ItemStatus itemStatus)
        {
            var printOrderItemEntity = new MarketingPrintOrderItemEntity(printOrderItemId)
            {
                Status = (long)itemStatus
            };
            IRelationPredicateBucket relationPredicateBucket =
                new RelationPredicateBucket(MarketingPrintOrderItemFields.MarketingPrintOrderItemId == printOrderItemId);

            using (IDataAccessAdapter myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                return(myAdapter.UpdateEntitiesDirectly(printOrderItemEntity, relationPredicateBucket) > 0);
            }
        }
Esempio n. 6
0
        public PrintOrderItemViewData Create(DateTime eventDate, long eventId, string eventName, long printOrderId,
                                             MarketingPrintOrderItemEntity printOrderItem, PrintOrderItemTrackingEntity printOrderItemTracking,
                                             string vendorName, string marketingMaterialType, string marketingMaterialName, string placedBy,
                                             MarketingOrderShippingInfoEntity printOrderShipping)
        {
            var itemFactory = new PrintOrderItemFactory();

            return(new PrintOrderItemViewData
            {
                EventDate = eventDate,
                EventId = eventId,
                EventName = eventName,
                PrintOrderId = printOrderId,
                MarketingMaterialType = marketingMaterialType,
                MarketingMaterialName = marketingMaterialName,
                PrintOrderItem = itemFactory.CreatePrintOrderItem(printOrderItem, printOrderItemTracking, printOrderShipping),
                PrintVendor = vendorName,
                OrderPlacedBy = placedBy
            });
        }
        protected MarketingPrintOrderProspectListMappingEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _marketingPrintOrderItem = (MarketingPrintOrderItemEntity)info.GetValue("_marketingPrintOrderItem", typeof(MarketingPrintOrderItemEntity));
                if (_marketingPrintOrderItem != null)
                {
                    _marketingPrintOrderItem.AfterSave += new EventHandler(OnEntityAfterSave);
                }
                _prospectListDetails = (ProspectListDetailsEntity)info.GetValue("_prospectListDetails", typeof(ProspectListDetailsEntity));
                if (_prospectListDetails != null)
                {
                    _prospectListDetails.AfterSave += new EventHandler(OnEntityAfterSave);
                }

                base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
            }

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
Esempio n. 8
0
        public PrintOrderItem CreatePrintOrderItem(MarketingPrintOrderItemEntity printOrderItemEntity,
                                                   PrintOrderItemTrackingEntity printOrderItemTrackingEntity, MarketingOrderShippingInfoEntity printOrderItemShipping)
        {
            return(new PrintOrderItem(printOrderItemEntity.MarketingPrintOrderItemId)
            {
                PrintOrderItemId = printOrderItemEntity.MarketingPrintOrderItemId,
                SourceCode = RemoveSourceCodeIdFromPrintOrderItemEntity(printOrderItemEntity.Sourcecode),
                Quantity = printOrderItemEntity.Quantity != null ? (long)printOrderItemEntity.Quantity : 0,
                Status = printOrderItemEntity.Status != null ? (ItemStatus)printOrderItemEntity.Status : ItemStatus.Unknown,
                Shipping = new PrintOrderItemShipping
                {
                    ShippedToAddress1 = printOrderItemShipping.Address1,
                    ShippedToAddress2 = printOrderItemShipping.Address2,
                    ShippedToCity = printOrderItemShipping.City,
                    ShippedToState = printOrderItemShipping.State,
                    ShippedToZip = printOrderItemShipping.ZipCode.ToString(),
                    ShipToAttentionOf = printOrderItemShipping.FirstName + " " + printOrderItemShipping.LastName,
                    ShippedPhoneNumber = printOrderItemShipping.PhoneNumber
                },

                TrackingInfo = printOrderItemTrackingEntity != null?_mapper.Map(printOrderItemTrackingEntity) : null
            });
        }
 /// <summary> Removes the sync logic for member _marketingPrintOrderItem</summary>
 /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
 /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
 private void DesetupSyncMarketingPrintOrderItem(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_marketingPrintOrderItem, new PropertyChangedEventHandler(OnMarketingPrintOrderItemPropertyChanged), "MarketingPrintOrderItem", MarketingPrintOrderProspectListMappingEntity.Relations.MarketingPrintOrderItemEntityUsingMarketingPrintOrderItemId, true, signalRelatedEntity, "MarketingPrintOrderProspectListMapping", resetFKFields, new int[] { (int)MarketingPrintOrderProspectListMappingFieldIndex.MarketingPrintOrderItemId });
     _marketingPrintOrderItem = null;
 }