Beispiel #1
0
 public IEnumerable <CRSMEmail> ReceiveMessage(PXSyncMailbox mailbox)
 {
     using (ExchangeEmailsSyncCommand cmd = new ExchangeEmailsSyncCommand(this))
     {
         throw new NotImplementedException();
     }
 }
Beispiel #2
0
 public void SendMessage(PXSyncMailbox mailbox, IEnumerable <CRSMEmail> activities)
 {
     using (ExchangeEmailsSyncCommand cmd = new ExchangeEmailsSyncCommand(this))
     {
         cmd.SendMessage(mailbox, activities);
     }
 }
Beispiel #3
0
        public PXSyncItemBucket(PXSyncMailbox mailbox, PXSyncItemStatus status, EMailSyncReference reference, T1 item1)
        {
            ID = Guid.NewGuid().ToString();

            Item1     = item1;
            Mailbox   = mailbox;
            Status    = status;
            Reference = reference;
        }
Beispiel #4
0
        private static Tuple <EMailSyncServer, EMailSyncPolicy, PXSyncMailbox> GetConfig(int emailAccountID)
        {
            PXGraph graph = new PXGraph();

            foreach (PXResult <EMailSyncAccount, EMailSyncServer, EMailAccount, EPEmployee, Contact> row in
                     PXSelectJoin <EMailSyncAccount,
                                   InnerJoin <EMailSyncServer, On <EMailSyncServer.accountID, Equal <EMailSyncAccount.serverID> >,
                                              InnerJoin <EMailAccount, On <EMailAccount.emailAccountID, Equal <EMailSyncAccount.emailAccountID> >,
                                                         LeftJoin <EPEmployee, On <EMailSyncAccount.employeeID, Equal <EPEmployee.bAccountID> >,
                                                                   LeftJoin <Contact, On <EPEmployee.defContactID, Equal <Contact.contactID>, And <EPEmployee.parentBAccountID, Equal <Contact.bAccountID> > > > > > >,
                                   Where <EMailSyncAccount.emailAccountID, Equal <Required <EMailSyncAccount.emailAccountID> > >,
                                   OrderBy <Asc <EMailSyncAccount.serverID, Asc <EMailSyncAccount.employeeID> > > > .SelectSingleBound(graph, null, emailAccountID))
            {
                EMailSyncServer  server       = row;
                EMailSyncAccount account      = row;
                Contact          contact      = row;
                EMailAccount     eMailAccount = row;

                if (server == null || account == null || String.IsNullOrEmpty(account.Address))
                {
                    throw new PXException(Messages.EmailExchangeAccountNotFound);
                }
                if (server.IsActive != true)
                {
                    throw new PXException(Messages.EmailExchangeAccountNotEnabled);
                }

                string address = (contact != null ? contact.EMail : null) ?? account.Address;

                PXSyncMailbox mailbox = new PXSyncMailbox(address, account.EmployeeID.Value, emailAccountID, new PXSyncMailboxPreset(null, null), new PXSyncMailboxPreset(null, null), eMailAccount.IncomingProcessing ?? false);

                string          policyName = account.PolicyName ?? server.DefaultPolicyName;
                EMailSyncPolicy policy     = PXSelect <EMailSyncPolicy, Where <EMailSyncPolicy.policyName, Equal <Required <EMailSyncPolicy.policyName> > > > .SelectSingleBound(graph, null, policyName);

                if (policy == null)
                {
                    throw new PXException(Messages.EmailExchangePolicyNotFound, account.Address);
                }

                if (String.IsNullOrEmpty(server.ServerType) || !_exchangers.ContainsKey(server.ServerType))
                {
                    throw new PXException(Messages.EmailExchangeProviderNotFound);
                }

                return(Tuple.Create(server, policy, mailbox));
            }

            throw new PXException(Messages.EmailExchangeAccountNotFound);
        }
Beispiel #5
0
        public override BaseFolderIdType Evaluate(PXSyncMailbox mailbox, ItemType item)
        {
            bool?income = Command.EvaluateIncomming(mailbox.Address, item);

            if (income == null)
            {
                return(null);
            }

            if (Incomming && (income ?? false))
            {
                return(FolderId);
            }
            if (Outgoing && !(income ?? false))
            {
                return(FolderId);
            }

            return(null);
        }
Beispiel #6
0
 public abstract BaseFolderIdType Evaluate(PXSyncMailbox mailbox, ItemType item);