Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="f1Phones"></param>
        /// <param name="pcoPhones"></param>
        private void UpdatePhoneCommunications(F1toPCO.Model.F1.communications f1Phones, F1toPCO.Model.PCO.phoneNumbers pcoPhones)
        {
            foreach (F1toPCO.Model.F1.EntityType et in F1toPCO.Model.F1.phoneSyncType.Items)
            {
                F1toPCO.Model.F1.communication tmpF1Phone = f1Phones.FindByCommunicationTypeName(et.F1Type);
                F1toPCO.Model.PCO.phoneNumber tmpPCOPhone = pcoPhones.FindByLocation(et.PCOType);

                if (tmpF1Phone != null)
                {
                    if (tmpPCOPhone == null)
                    {
                        tmpPCOPhone = new Model.PCO.phoneNumber();
                        tmpPCOPhone.number = tmpF1Phone.communicationValue;
                        tmpPCOPhone.location = et.PCOType;
                        pcoPhones.phoneNumber.Add(tmpPCOPhone);
                    }
                    else
                    {
                        tmpPCOPhone.number = tmpF1Phone.communicationValue;
                    }
                }
                else
                {
                    if (tmpPCOPhone != null)
                    {
                        pcoPhones.phoneNumber.Remove(tmpPCOPhone);
                    }
                }
            }
        }
Ejemplo n.º 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);
                    }
                }

            }
        }