Exemplo n.º 1
0
        protected override APIPECMail.PECMailBox TransformDTO(DSW.PECMailBox entity)
        {
            if (entity == null)
            {
                throw new ArgumentException("Impossibile trasformare PECMailBox se l'entità non è inizializzata");
            }

            APIPECMail.PECMailBox apiPECMailBox = new APIPECMail.PECMailBox();
            apiPECMailBox.EntityId                  = entity.Id;
            apiPECMailBox.MailBoxRecipient          = entity.MailBoxName;
            apiPECMailBox.IdJeepServiceIncomingHost = entity.IdJeepServiceIncomingHost;
            apiPECMailBox.IdJeepServiceOutgoingHost = entity.IdJeepServiceOutgoingHost;
            apiPECMailBox.IncomingServer            = entity.IncomingServerName;
            apiPECMailBox.IncomingServerPort        = entity.IncomingServerPort;
            apiPECMailBox.IncomingServerProtocol    = (int?)entity.IncomingServerProtocol;
            apiPECMailBox.IncomingServerUseSsl      = entity.IncomingServerUseSsl;
            apiPECMailBox.IsDestinationEnabled      = entity.IsDestinationEnabled;
            apiPECMailBox.IsForInterop              = entity.IsForInterop;
            apiPECMailBox.IsHandleEnabled           = entity.IsHandleEnabled;
            apiPECMailBox.IsProtocolBox             = entity.IsProtocolBox;
            apiPECMailBox.IsProtocolBoxExplicit     = entity.IsProtocolBoxExplicit;
            apiPECMailBox.Location                  = entity.Location != null?_mapperLocation.MappingDTO(entity.Location) : null;

            apiPECMailBox.Managed              = entity.Managed;
            apiPECMailBox.OutgoingServer       = entity.OutgoingServerName;
            apiPECMailBox.OutgoingServerPort   = entity.OutgoingServerPort;
            apiPECMailBox.OutgoingServerUseSsl = entity.OutgoingServerUseSsl;
            apiPECMailBox.Password             = entity.Password;
            apiPECMailBox.Timestamp            = entity.Timestamp;
            apiPECMailBox.UniqueId             = entity.UniqueId;
            apiPECMailBox.Unmanaged            = entity.Unmanaged;
            apiPECMailBox.Username             = entity.Username;

            return(apiPECMailBox);
        }
Exemplo n.º 2
0
        protected override PECMail TransformDTO(DSW.PECMail entity)
        {
            if (entity == null)
            {
                throw new ArgumentException("Impossibile trasformare PECMail se l'entità non è inizializzata");
            }

            PECMail apiPECMail = new PECMail
            {
                Checksum               = entity.Checksum,
                DestinationNote        = entity.DestinationNote,
                Direction              = (PECMailDirection)entity.Direction,
                EntityId               = entity.Id,
                Handler                = entity.Handler,
                HeaderChecksum         = entity.HeaderChecksum,
                IDAttachments          = entity.IDAttachments,
                IDDaticert             = entity.IDDaticert,
                IDEnvelope             = entity.IDEnvelope,
                IDMailContent          = entity.IDMailContent,
                IDPostacert            = entity.IDPostacert,
                IDSegnatura            = entity.IDSegnatura,
                IDSmime                = entity.IDSmime,
                IsActive               = (PECMailActiveType)entity.IsActive,
                IsDestinated           = entity.IsDestinated,
                IsToForward            = entity.IsToForward,
                IsValidForInterop      = entity.IsValidForInterop,
                LastChangedDate        = entity.LastChangedDate,
                LastChangedUser        = entity.LastChangedUser,
                MailBody               = entity.MailBody,
                MailContent            = entity.MailContent,
                MailDate               = entity.MailDate,
                MailError              = entity.MailError,
                MailPriority           = (PECMailPriority?)entity.MailPriority,
                MailRecipients         = entity.MailRecipients,
                MailRecipientsCc       = entity.MailRecipientsCc,
                MailSenders            = entity.MailSenders,
                MailStatus             = entity.MailStatus,
                MailSubject            = entity.MailSubject,
                MailType               = entity.MailType,
                MailUID                = entity.MailUID,
                MessageID              = entity.MessageID,
                MessaggioRitornoName   = entity.MessaggioRitornoName,
                MessaggioRitornoStream = entity.MessaggioRitornoStream,
                Multiple               = entity.Multiple,
                MultipleType           = (PECMailMultipleType?)entity.MultipleType,
                Number             = entity.Number,
                OriginalRecipient  = entity.OriginalRecipient,
                PECType            = (PECType?)entity.PECType,
                ProcessStatus      = (PECMailProcessStatus?)entity.ProcessStatus,
                ReceivedAsCc       = entity.ReceivedAsCc,
                RecordedInDocSuite = Convert.ToByte(entity.RecordedInDocSuite),
                RegistrationDate   = entity.RegistrationDate,
                RegistrationUser   = entity.RegistrationUser,
                Segnatura          = entity.Segnatura,
                Size                                           = entity.Size,
                SplittedFrom                                   = entity.SplittedFrom,
                Timestamp                                      = entity.Timestamp,
                UniqueId                                       = entity.UniqueId,
                XRiferimentoMessageID                          = entity.XRiferimentoMessageID,
                XTrasporto                                     = entity.XTrasporto,
                Year                                           = entity.Year,
                InvoiceStatus                                  = (InvoiceStatus?)entity.InvoiceStatus,
                Location                                       = entity.Location != null?_mapperLocation.MappingDTO(entity.Location) : null,
                                                  DocumentUnit = entity.DocumentUnit != null?_mapperDocumentUnit.MappingDTO(entity.DocumentUnit) : null,
                                                                     PECMailBox = entity.MailBox != null?_mapperPECMailBox.MappingDTO(entity.MailBox) : null,
                                                                                      Attachments = entity.Attachments.Select(f => _mapperPECMailAttachment.MappingDTO(f)).ToList()
            };

            return(apiPECMail);
        }