Ejemplo n.º 1
0
        public ServiceOrderDestinationAgentMapperProfile()
        {
            CreateMap <GetServiceOrderDestinationAgentResponse, GetServiceOrderDestinationAgentResponse>();

            CreateMap <ServiceOrderDestinationAgent, ServiceOrderBaseResponse>()
            .ForPath(d => d.VendorId, opt => opt.MapFrom(src => src.ServiceOrder.VendorId))
            .ForPath(d => d.VendorName, opt => opt.MapFrom(src => src.ServiceOrder.Vendor.Name))
            .ForMember(d => d.QuoteReferenceNumber, opt => opt.MapFrom(src => src.ServiceOrder.QuoteReferenceNumber))
            .Include <ServiceOrderDestinationAgent, GetServiceOrderDestinationAgentResponse>();

            CreateMap <GetServiceOrderDestinationAgentResponse, ServiceOrderDestinationAgent>()
            .ForPath(d => d.ServiceOrder.VendorId, opt => opt.MapFrom(src => src.VendorId))
            .ForPath(d => d.ServiceOrder.QuoteReferenceNumber, opt => opt.MapFrom(src => src.QuoteReferenceNumber))
            .ForPath(d => d.ScheduledDeliveryStartTime, opt => opt.MapFrom(src => DtoTranslations.ToTimeSpan(src.ScheduledDeliveryStartTime)))
            .ForPath(d => d.ScheduledDeliveryEndTime, opt => opt.MapFrom(src => DtoTranslations.ToTimeSpan(src.ScheduledDeliveryEndTime)));

            CreateMap <ServiceOrderDestinationAgent, GetServiceOrderDestinationAgentResponse>()
            .ForPath(d => d.ScheduledDeliveryStartTime, opt => opt.MapFrom(src => DtoTranslations.ToDateTime(src.ScheduledDeliveryStartDate, src.ScheduledDeliveryStartTime)))
            .ForPath(d => d.ScheduledDeliveryEndTime, opt => opt.MapFrom(src => DtoTranslations.ToDateTime(src.ScheduledDeliveryEndDate, src.ScheduledDeliveryEndTime)))
            .ForPath(d => d.IsPartialDeliveryExists, opt => opt.MapFrom(src => CheckIfPartialDeliveryExists(src.ServiceOrder)));

            CreateMap <ServiceOrderDestinationAgentPartialDelivery, GetDestinationAgentPartialDeliveryResponse>().ReverseMap();

            CreateMap <GetDestinationAgentPartialDeliveryResponse, GetDestinationAgentPartialDeliveryResponse>();
        }
Ejemplo n.º 2
0
        public ServiceOrderMoveInfoMapperProfile()
        {
            CreateMap <ServiceOrderMoveInfo, ServiceOrderBaseResponse>()
            .ForPath(d => d.VendorId, opt => opt.MapFrom(src => src.ServiceOrder.VendorId))
            .ForPath(d => d.VendorName, opt => opt.MapFrom(src => src.ServiceOrder.Vendor.Name))
            .ForMember(d => d.QuoteReferenceNumber, opt => opt.MapFrom(src => src.ServiceOrder.QuoteReferenceNumber))
            .Include <ServiceOrderMoveInfo, GetServiceOrderOriginAgentResponse>();

            CreateMap <GetServiceOrderOriginAgentResponse, ServiceOrderMoveInfo>()
            .ForPath(d => d.ServiceOrder.VendorId, opt => opt.MapFrom(src => src.VendorId))
            .ForPath(d => d.ServiceOrder.QuoteReferenceNumber, opt => opt.MapFrom(src => src.QuoteReferenceNumber))
            .ForPath(d => d.EstimatedPackStartTime, opt => opt.MapFrom(src => DtoTranslations.ToTimeSpan(src.EstimatedPackStartTime)))
            .ForPath(d => d.EstimatedPackEndTime, opt => opt.MapFrom(src => DtoTranslations.ToTimeSpan(src.EstimatedPackEndTime)))
            .ForPath(d => d.ServiceOrder.ISAllDocumentsReceived, opt => opt.MapFrom(src => src.IsAllDocumentsReceived))
            ;

            CreateMap <ServiceOrderMoveInfo, GetServiceOrderOriginAgentResponse>()
            .ForPath(d => d.EstimatedPackStartTime, opt => opt.MapFrom(src => DtoTranslations.ToDateTime(src.EstimatedPackStartDate, src.EstimatedPackStartTime)))
            .ForPath(d => d.EstimatedPackEndTime, opt => opt.MapFrom(src => DtoTranslations.ToDateTime(src.EstimatedPackEndDate, src.EstimatedPackEndTime)))
            .ForPath(d => d.IsAllDocumentsReceived, opt => opt.MapFrom(src => src.ServiceOrder.ISAllDocumentsReceived))
            ;

            CreateMap <ServiceOrderBaseResponse, GetServiceOrderOriginAgentResponse>().ReverseMap();
        }