Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="f1Emails"></param>
        /// <param name="pcoEmails"></param>
        private void UpdateEmailCommunications(F1toPCO.Model.F1.communications f1Emails, F1toPCO.Model.PCO.emailAddresses pcoEmails)
        {
            foreach (F1toPCO.Model.F1.EntityType et in F1toPCO.Model.F1.emailSyncType.Items)
            {
                F1toPCO.Model.F1.communication tmpF1Email  = f1Emails.FindByCommunicationTypeName(et.F1Type);
                F1toPCO.Model.PCO.emailAddress tmpPCOEmail = pcoEmails.FindByLocation(et.PCOType);

                if (tmpF1Email != null)
                {
                    if (tmpPCOEmail == null)
                    {
                        tmpPCOEmail          = new Model.PCO.emailAddress();
                        tmpPCOEmail.address  = tmpF1Email.communicationValue;
                        tmpPCOEmail.location = et.PCOType;
                        pcoEmails.emailAddress.Add(tmpPCOEmail);
                    }
                    else
                    {
                        tmpPCOEmail.address = tmpF1Email.communicationValue;
                    }
                }
                else
                {
                    if (tmpPCOEmail != null)
                    {
                        pcoEmails.emailAddress.Remove(tmpPCOEmail);
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="f1Emails"></param>
        /// <param name="pcoEmails"></param>
        private void UpdateEmailCommunications(F1toPCO.Model.F1.communications f1Emails, F1toPCO.Model.PCO.emailAddresses pcoEmails)
        {
            foreach (F1toPCO.Model.F1.EntityType et in F1toPCO.Model.F1.emailSyncType.Items)
            {
                F1toPCO.Model.F1.communication tmpF1Email = f1Emails.FindByCommunicationTypeName(et.F1Type);
                F1toPCO.Model.PCO.emailAddress tmpPCOEmail = pcoEmails.FindByLocation(et.PCOType);

                if (tmpF1Email != null)
                {
                    if (tmpPCOEmail == null)
                    {
                        tmpPCOEmail = new Model.PCO.emailAddress();
                        tmpPCOEmail.address = tmpF1Email.communicationValue;
                        tmpPCOEmail.location = et.PCOType;
                        pcoEmails.emailAddress.Add(tmpPCOEmail);
                    }
                    else
                    {
                        tmpPCOEmail.address = tmpF1Email.communicationValue;
                    }
                }
                else
                {
                    if (tmpPCOEmail != null)
                    {
                        pcoEmails.emailAddress.Remove(tmpPCOEmail);
                    }
                }

            }
        }