Esempio n. 1
0
        public static void Insert(DefaultContext db, int userId, ref PeopleContact peopleContact)
        {
            peopleContact.Created = DateTime.Now;
            peopleContact.RegistrarId = userId;
            db.PeopleContacts.Add(peopleContact);
            db.SaveChanges();

            peopleContact.CheckDuplicity(db);
        }
Esempio n. 2
0
        public static PeopleContactDetails GetModelView(PeopleContact peopleContact)
        {
            if (peopleContact == null)
                return null;

            var peopleContactDetails = new PeopleContactDetails(peopleContact);
            return peopleContactDetails;
        }
Esempio n. 3
0
 /// <summary>
 /// Creates the events after business info participated.
 /// </summary>
 /// <param name="peopleContact">The people contact.</param>
 private void CreateEventsAfterBusinessInfoParticipated(PeopleContact peopleContact)
 {
     peopleContact.ThirdMeeting = null;
     peopleContact.TeamMeetingParticipated = null;
     peopleContact.WorkflowState = !peopleContact.SecondContacted.HasValue
                                       ? WorkflowState.BusinessInfoParticipated
                                       : WorkflowState.SecondContactedAndBusinessInfoParticipated;
 }
Esempio n. 4
0
        public void UpdatePeopleContacts()
        {
            ValidateHeaderDataForPeopleContacts();

            IEnumerable<string> emails = GetEmails();
            PeopleContact[] peopleContacts = _db.PeopleContacts.Where(pc => pc.RegistrarId == _userId && emails.Contains(pc.Email1.ToLower())).ToArray();

            int updatedContacts = 0;
            int addedContacts = 0;
            int notProcessedContacts = 0;
            var notProcessedMessage = new StringBuilder();
            PhoneNumberPrefix[] phoneNumberPrefixes = _db.PhoneNumberPrefixes.ToArray();
            DateTime createdSnapshot = DateTime.Now;
            for (int i = 0; i < _csvData.Rows.Count; i++)
            {
                var csvPeopleContact = new CsvPeopleContact(_csvData.Rows[i], phoneNumberPrefixes);
                if (!csvPeopleContact.IsValid)
                {
                    notProcessedContacts++;
                    notProcessedMessage.AppendLine(csvPeopleContact.ErrorMessage);
                    continue;
                }

                PeopleContact peopleContact = peopleContacts.FirstOrDefault(pc => pc.Email1.ToLower() == csvPeopleContact.Data.Email1);
                if (peopleContact == null)
                {
                    peopleContact = new PeopleContact
                                        {
                                            FirstName = csvPeopleContact.Data.FirstName,
                                            LastName = csvPeopleContact.Data.LastName,
                                            Email1 = csvPeopleContact.Data.Email1,
                                            PhoneNumberPrefix1Id = csvPeopleContact.Data.PhoneNumberPrefix1Id,
                                            PhoneNumber1 = csvPeopleContact.Data.PhoneNumber1,
                                            Created = createdSnapshot,
                                            RegistrarId = _userId
                                        };
                    _db.PeopleContacts.Add(peopleContact);
                    addedContacts++;
                }
                else if (peopleContact.FirstName != csvPeopleContact.Data.FirstName || peopleContact.LastName != csvPeopleContact.Data.LastName || peopleContact.PhoneNumberPrefix1Id != csvPeopleContact.Data.PhoneNumberPrefix1Id || peopleContact.PhoneNumber1 != csvPeopleContact.Data.PhoneNumber1)
                {
                    peopleContact.FirstName = csvPeopleContact.Data.FirstName;
                    peopleContact.LastName = csvPeopleContact.Data.LastName;
                    peopleContact.PhoneNumberPrefix1Id = csvPeopleContact.Data.PhoneNumberPrefix1Id;
                    peopleContact.PhoneNumber1 = csvPeopleContact.Data.PhoneNumber1;
                    _db.Entry(peopleContact).State = EntityState.Modified;
                    updatedContacts++;
                }
            }

            _db.SaveChanges();

            _summaryMesage.AppendLine(String.Format(ViewResource.PeopleContact_ImportSummary_Text,
                                                    _csvData.Rows.Count, addedContacts, updatedContacts,
                                                    notProcessedContacts));

            if (notProcessedContacts == 0)
                return;

            _summaryMesage.AppendLine(String.Format("{0}{1}", Environment.NewLine,
                                                    String.Format(
                                                        ViewResource.PeopleContact_NotProccessedSummary_Text,
                                                        notProcessedMessage)));
        }
Esempio n. 5
0
        /// <summary>
        /// Checks the workflow.
        /// </summary>
        /// <param name="peopleContact">The peopleContactEdit.</param>
        /// <param name="previousPeopleContact">The previous people contact.</param>
        /// <param name="calendar">The calendar.</param>
        /// <returns>Task.</returns>
        private void CheckWorkflow(PeopleContact peopleContact, PeopleContact previousPeopleContact, Calendar calendar)
        {
            if (calendar.UseGoogleCalendar && !calendar.Authorized)
            {
                TempData[StatusMessageTempKey] = ValidationResource.Global_CannotConnectToGoogleCalendar_ErrorMessage;
            }

            if (!previousPeopleContact.Presented.HasValue && peopleContact.Presented.HasValue)
            {
                CreateEventsAfterPresentedAsync(peopleContact, calendar);
                return;
            }

            if (!previousPeopleContact.SecondContacted.HasValue && peopleContact.SecondContacted.HasValue)
            {
                CreateEventsAfterSecondContactedAsync(peopleContact, calendar);
            }

            if (!previousPeopleContact.BusinessInfoParticipated.HasValue && peopleContact.BusinessInfoParticipated.HasValue)
            {
                CreateEventsAfterBusinessInfoParticipatedAsync(peopleContact, calendar);
            }

            if (peopleContact.SecondMeeting.HasValue && peopleContact.ThirdMeeting.HasValue && peopleContact.TrackingEmailSent && peopleContact.SecondTrackingEmailSent)
            {
                peopleContact.WorkflowState = WorkflowState.Finished;
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Creates the events after presented.
        /// </summary>
        /// <param name="peopleContact">The people contact.</param>
        /// <param name="calendar">The calendar.</param>
        /// <returns>Task.</returns>
        private void CreateEventsAfterPresentedAsync(PeopleContact peopleContact, Calendar calendar)
        {
            CreateEventsAfterPresented(peopleContact);

            if (calendar == null || (calendar.UseGoogleCalendar && !calendar.Authorized))
                return;

            var events = new Event[2];
            DateTime startDate = peopleContact.Presented.GetValueOrDefault(DateTime.Today).AddDays(1);
            events[0] = new Event
                            {
                                Start = new EventDateTime { DateTime = startDate },
                                End = new EventDateTime { DateTime = startDate.AddDays(1) },
                                Summary = String.Format(GoogleCalendarResource.PeopleContactController_CreateEventsAfterPresentedAsync1_Summary, peopleContact.LastName, peopleContact.FirstName),
                                Description = String.Format(GoogleCalendarResource.PeopleContactController_CreateEventsAfterPresentedAsync1_Description, peopleContact.LastName, peopleContact.FirstName)
                            };

            events[1] = new Event
                            {
                                Start = new EventDateTime { DateTime = startDate },
                                End = new EventDateTime { DateTime = startDate.AddDays(14) },
                                Summary = String.Format(GoogleCalendarResource.PeopleContactController_CreateEventsAfterPresentedAsync2_Summary, peopleContact.LastName, peopleContact.FirstName),
                                Description = String.Format(GoogleCalendarResource.PeopleContactController_CreateEventsAfterPresentedAsync2_Description, peopleContact.LastName, peopleContact.FirstName)
                            };
            calendar.InsertEvents(events);
        }
Esempio n. 7
0
 public PeopleContactIndex(PeopleContact peopleContact)
 {
     PeopleContactId = peopleContact.PeopleContactId;
     FirstName = peopleContact.FirstName;
     LastName = peopleContact.LastName;
     City = peopleContact.City;
     PhoneNumberPrefix1 = PhoneNumberPrefixDetails.GetModelView(peopleContact.PhoneNumberPrefix1);
     Email1 = peopleContact.Email1;
     TeamMeetingParticipated = peopleContact.TeamMeetingParticipated;
     PremiumMembershipGranted = peopleContact.PremiumMembershipGranted;
     Potential = peopleContact.Potential;
     ContactDead = peopleContact.ContactDead;
     PhoneNumber1 = peopleContact.PhoneNumber1;
     Skype = peopleContact.Skype;
     WorkflowState = peopleContact.WorkflowState;
 }
Esempio n. 8
0
 private bool IsAccessSendVideo(PeopleContact peopleContact)
 {
     bool isAccess = IsAccessDetails(peopleContact) && !String.IsNullOrEmpty(peopleContact.Email1);
     return isAccess;
 }
Esempio n. 9
0
        public static PeopleContactEdit GetModelView(PeopleContact peopleContact)
        {
            if (peopleContact == null)
                return null;

            var peopleContactEdit = new PeopleContactEdit(peopleContact);
            return peopleContactEdit;
        }
Esempio n. 10
0
 public PeopleContact GetModel()
 {
     var peopleContact = new PeopleContact
                             {
                                 PeopleContactId = PeopleContactId,
                                 DistrictId = DistrictId,
                                 PhoneNumberPrefix1Id = PhoneNumberPrefix1Id,
                                 PhoneNumberPrefix2Id = PhoneNumberPrefix2Id,
                                 RegistrarId = RegistrarId,
                                 FirstName = FirstName,
                                 LastName = LastName,
                                 City = City,
                                 Title = Title,
                                 PhoneNumber2 = PhoneNumber2,
                                 Email1 = Email1,
                                 Email2 = Email2,
                                 Created = Created,
                                 FirstContacted = FirstContacted,
                                 Presented = Presented,
                                 BusinessInfoParticipated = BusinessInfoParticipated,
                                 TeamMeetingParticipated = TeamMeetingParticipated,
                                 Registrated = Registrated,
                                 PremiumMembershipGranted = PremiumMembershipGranted,
                                 Potential = Potential,
                                 MobileApplicationInstalledAndTrained = MobileApplicationInstalledAndTrained,
                                 ContactDead = ContactDead,
                                 PhoneNumber1 = PhoneNumber1,
                                 Skype = Skype,
                                 TrackingEmailSent = TrackingEmailSent,
                                 SecondContacted = SecondContacted,
                                 SecondMeeting = SecondMeeting,
                                 SecondTrackingEmailSent = SecondTrackingEmailSent,
                                 ThirdMeeting = ThirdMeeting,
                                 LoyaltySystemExplained = LoyaltySystemExplained,
                                 AccessGranted = AccessGranted,
                                 MoneyToPurchaseAccountSended = MoneyToPurchaseAccountSended,
                                 AbleToPurchase = AbleToPurchase,
                                 AutoCashback = AutoCashback,
                                 ShoppingPlanBackSet = ShoppingPlanBackSet,
                                 OwnUnitsContained = OwnUnitsContained,
                                 Tasks = Tasks,
                                 Note = Note,
                                 LyonessId = LyonessId,
                                 WorkflowState = WorkflowState,
                                 ConfirmTermsAndConditions = ConfirmTermsAndConditions,
                                 ConfirmPersonalData = ConfirmPersonalData
                             };
     return peopleContact;
 }
Esempio n. 11
0
        public static DeleteResult Delete(DefaultContext db, int id, out PeopleContact peopleContact)
        {
            peopleContact = GetDetail(db, id);
            if (peopleContact == null)
                return DeleteResult.AuthorizationFailed;

            try
            {
                var parameter = new SqlParameter(PeopleContactIdSqlParameter, peopleContact.PeopleContactId);
                db.Database.ExecuteSqlCommand(CascadeRemovePeopleContactProcedureTemplate, parameter);
                return DeleteResult.Ok;
            }
            catch (Exception e)
            {
                Logger.SetLog(e);
                return DeleteResult.DbFailed;
            }
        }
Esempio n. 12
0
        public static bool Update(DefaultContext db, ref PeopleContact peopleContact)
        {
            int peopleContactId = peopleContact.PeopleContactId;
            PeopleContact dbPeopleContact = GetDetail(db, peopleContactId);
            if (dbPeopleContact == null)
                return false;

            dbPeopleContact.CopyFrom(peopleContact);
            db.SaveChanges();
            peopleContact = dbPeopleContact;
            return true;
        }
Esempio n. 13
0
        public static void Insert(DefaultContext db, int userId, ref MultiplePeopleContacts multiplePeopleContacts)
        {
            DateTime created = DateTime.Now;
            foreach (MultiplePeopleContact multiplePeopleContact in multiplePeopleContacts.MultiplePeopleContactsList)
            {
                var peopleContact = new PeopleContact
                                        {
                                            LastName = multiplePeopleContact.LastName,
                                            FirstName = multiplePeopleContact.FirstName,
                                            City = multiplePeopleContact.City,
                                            PhoneNumber1 = multiplePeopleContact.PhoneNumber1,
                                            Email1 = multiplePeopleContact.Email1,
                                            Skype = multiplePeopleContact.Skype,
                                            Created = created,
                                            RegistrarId = userId
                                        };
                if (!String.IsNullOrEmpty(peopleContact.PhoneNumber1))
                    peopleContact.PhoneNumberPrefix1Id = multiplePeopleContact.PhoneNumberPrefix1Id;

                db.PeopleContacts.Add(peopleContact);
            }

            db.SaveChanges();
        }
Esempio n. 14
0
 public PeopleContactEdit(PeopleContact peopleContact)
 {
     PeopleContactId = peopleContact.PeopleContactId;
     DistrictId = peopleContact.DistrictId;
     PhoneNumberPrefix1Id = peopleContact.PhoneNumberPrefix1Id;
     PhoneNumberPrefix2Id = peopleContact.PhoneNumberPrefix2Id;
     RegistrarId = peopleContact.RegistrarId;
     FirstName = peopleContact.FirstName;
     LastName = peopleContact.LastName;
     City = peopleContact.City;
     Title = peopleContact.Title;
     PhoneNumber2 = peopleContact.PhoneNumber2;
     Email1 = peopleContact.Email1;
     Email2 = peopleContact.Email2;
     Created = peopleContact.Created;
     FirstContacted = peopleContact.FirstContacted;
     Presented = peopleContact.Presented;
     BusinessInfoParticipated = peopleContact.BusinessInfoParticipated;
     TeamMeetingParticipated = peopleContact.TeamMeetingParticipated;
     Registrated = peopleContact.Registrated;
     PremiumMembershipGranted = peopleContact.PremiumMembershipGranted;
     Potential = peopleContact.Potential;
     MobileApplicationInstalledAndTrained = peopleContact.MobileApplicationInstalledAndTrained;
     ContactDead = peopleContact.ContactDead;
     PhoneNumber1 = peopleContact.PhoneNumber1;
     Skype = peopleContact.Skype;
     TrackingEmailSent = peopleContact.TrackingEmailSent;
     SecondContacted = peopleContact.SecondContacted;
     SecondMeeting = peopleContact.SecondMeeting;
     SecondTrackingEmailSent = peopleContact.SecondTrackingEmailSent;
     ThirdMeeting = peopleContact.ThirdMeeting;
     LoyaltySystemExplained = peopleContact.LoyaltySystemExplained;
     AccessGranted = peopleContact.AccessGranted;
     MoneyToPurchaseAccountSended = peopleContact.MoneyToPurchaseAccountSended;
     AbleToPurchase = peopleContact.AbleToPurchase;
     AutoCashback = peopleContact.AutoCashback;
     ShoppingPlanBackSet = peopleContact.ShoppingPlanBackSet;
     OwnUnitsContained = peopleContact.OwnUnitsContained;
     Tasks = peopleContact.Tasks;
     Note = peopleContact.Note;
     LyonessId = peopleContact.LyonessId;
     WorkflowState = peopleContact.WorkflowState;
     ConfirmTermsAndConditions = peopleContact.ConfirmTermsAndConditions;
     ConfirmPersonalData = peopleContact.ConfirmPersonalData;
 }
Esempio n. 15
0
        public static PeopleContactIndex[] GetModelView(PeopleContact[] peopleContacts)
        {
            if (peopleContacts == null)
                return null;

            PeopleContactIndex[] peopleContactIndex = peopleContacts.Select(pc => new PeopleContactIndex(pc)).ToArray();
            return peopleContactIndex;
        }
Esempio n. 16
0
 private bool IsAccessDetails(PeopleContact peoplecontact)
 {
     bool isAccess = peoplecontact != null && FilteredUser.GetFilteredUsers(Db, UserId).Any(gfu => gfu.UserId == peoplecontact.RegistrarId);
     return isAccess;
 }
Esempio n. 17
0
 private PeopleContactSendVideo(PeopleContact peopleContact)
 {
     PeopleContactId = peopleContact.PeopleContactId;
     FullName = peopleContact.FullName;
 }
Esempio n. 18
0
        public async Task<ActionResult> EditTask(PeopleContactTask peopleContactTask, CancellationToken cancellationToken)
        {
            if (peopleContactTask.RegistrarId != UserId)
                return RedirectToAccessDenied();

            PeopleContact peopleContact = PeopleContactCache.GetDetailWithRegister(Db, peopleContactTask.PeopleContactId);
            if (peopleContact.RegistrarId != UserId)
                return RedirectToAccessDenied();

            var previousPeopleContact = new PeopleContact();
            previousPeopleContact.CopyFrom(peopleContact);

            PeopleContactTask tempPeopleContactTask = peopleContact.GetPeopleContactTasks(peopleContactTask.FieldName);
            peopleContactTask.Text = tempPeopleContactTask.Text;

            if (peopleContactTask.FieldValue == null)
            {
                ModelState.AddModelError(BaseCache.FieldValueField, String.Format(ValidationResource.Global_Required_ErrorMessage, FieldResource.Global_Date_Name));
            }
            else
            {
                switch (peopleContactTask.FieldName)
                {
                    case BaseCache.TrackingEmailSentField:
                        peopleContact.TrackingEmailSent = true;
                        if (peopleContact.Presented != null && (peopleContactTask.FieldValue < peopleContact.Presented.Value || peopleContactTask.FieldValue > DateTime.Today))
                        {
                            ModelState.AddModelError(BaseCache.FieldValueField, ValidationResource.PeopleContact_TrackingEmailSentAndPresentedComparing_ErrorMessage);
                        }
                        break;

                    case BaseCache.SecondContactedField:
                        peopleContact.SecondContacted = peopleContactTask.FieldValue;
                        if (peopleContact.Presented != null && (peopleContactTask.FieldValue < peopleContact.Presented.Value || peopleContactTask.FieldValue > DateTime.Today))
                        {
                            ModelState.AddModelError(BaseCache.FieldValueField, ValidationResource.PeopleContact_SecondContactedAndPresentedComparing_ErrorMessage);
                        }
                        break;

                    case BaseCache.SecondTrackingEmailSentField:
                        peopleContact.SecondTrackingEmailSent = true;
                        if (peopleContact.SecondContacted != null && (peopleContactTask.FieldValue < peopleContact.SecondContacted.Value || peopleContactTask.FieldValue > DateTime.Today))
                        {
                            ModelState.AddModelError(BaseCache.FieldValueField, ValidationResource.PeopleContact_SecondTrackingEmailSentAndSecondContactedComparing_ErrorMessage);
                        }
                        break;

                    case BaseCache.BusinessInfoParticipatedField:
                        peopleContact.BusinessInfoParticipated = peopleContactTask.FieldValue;
                        if (peopleContact.Presented != null && (peopleContactTask.FieldValue < peopleContact.Presented.Value || peopleContactTask.FieldValue > DateTime.Today))
                        {
                            ModelState.AddModelError(BaseCache.FieldValueField, ValidationResource.PeopleContact_BusinessInfoParticipatedAndPresentedComparing_ErrorMessage);
                        }
                        break;

                    case BaseCache.SecondMeetingField:
                        peopleContact.SecondMeeting = peopleContactTask.FieldValue;
                        if (peopleContact.SecondContacted != null && (peopleContactTask.FieldValue < peopleContact.SecondContacted.Value || peopleContactTask.FieldValue > DateTime.Today))
                        {
                            ModelState.AddModelError(BaseCache.FieldValueField, ValidationResource.PeopleContact_SecondMeetingAndSecondContactedComparing_ErrorMessage);
                        }
                        break;

                    case BaseCache.ThirdMeetingField:
                        peopleContact.ThirdMeeting = peopleContactTask.FieldValue;
                        if (peopleContact.BusinessInfoParticipated != null && (peopleContactTask.FieldValue < peopleContact.BusinessInfoParticipated.Value || peopleContactTask.FieldValue > DateTime.Today))
                        {
                            ModelState.AddModelError(BaseCache.FieldValueField, ValidationResource.PeopleContact_ThirdMeetingAndBusinessInfoParticipatedComparing_ErrorMessage);
                        }
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                }
            }

            if (ModelState.IsValid)
            {
                var calendar = new Calendar
                {
                    GoogleCredentialsJson = peopleContact.Registrar.GoogleCredentialsJson,
                    GoogleCalendarId = peopleContact.Registrar.GoogleCalendarId,
                    UseGoogleCalendarByUser = peopleContact.Registrar.UseGoogleCalendar,
                    UseMail = peopleContact.Registrar.UseMail,
                    EmailTo = peopleContact.Registrar.Email1,
                    ReminderTime = peopleContact.Registrar.ReminderTime,
                    IsEventsPrivate = peopleContact.Registrar.IsEventsPrivate
                };
                await calendar.AuthorizeAsync(this, cancellationToken);
                CheckWorkflow(peopleContact, previousPeopleContact, calendar);

                Db.Entry(peopleContact).State = EntityState.Modified;
                Db.SaveChanges();

                return View("EditTaskSummary", "_PopupLayout", peopleContactTask);
            }

            return View("EditTask", "_PopupLayout", peopleContactTask);
        }
Esempio n. 19
0
        public static PeopleContactSendVideo GetModelView(PeopleContact peopleContact)
        {
            if (peopleContact == null)
                return null;

            var peopleContactSendVideo = new PeopleContactSendVideo(peopleContact);
            return peopleContactSendVideo;
        }
Esempio n. 20
0
 /// <summary>
 /// Creates the events after presented.
 /// </summary>
 /// <param name="peopleContact">The people contact.</param>
 private void CreateEventsAfterPresented(PeopleContact peopleContact)
 {
     peopleContact.TrackingEmailSent = false;
     peopleContact.SecondContacted = null;
     peopleContact.SecondMeeting = null;
     peopleContact.SecondTrackingEmailSent = false;
     peopleContact.BusinessInfoParticipated = null;
     peopleContact.ThirdMeeting = null;
     peopleContact.TeamMeetingParticipated = null;
     peopleContact.WorkflowState = WorkflowState.Presented;
 }
Esempio n. 21
0
 public PeopleContactDelete(PeopleContact peopleContact)
 {
     FirstName = peopleContact.FirstName;
     LastName = peopleContact.LastName;
     City = peopleContact.City;
 }
Esempio n. 22
0
 /// <summary>
 /// Creates the events in reset business info.
 /// </summary>
 /// <param name="peopleContact">The people contact.</param>
 private void CreateEventsInResetBusinessInfo(PeopleContact peopleContact)
 {
     if (peopleContact.WorkflowState == WorkflowState.BusinessInfoParticipated)
     {
         CreateEventsAfterPresented(peopleContact);
     }
     else
     {
         peopleContact.BusinessInfoParticipated = null;
         peopleContact.ThirdMeeting = null;
         peopleContact.TeamMeetingParticipated = null;
         peopleContact.WorkflowState = WorkflowState.SecondContacted;
     }
 }
Esempio n. 23
0
        public static PeopleContactDelete GetModelView(PeopleContact peopleContact)
        {
            if (peopleContact == null)
                return null;

            var peopleContactDelete = new PeopleContactDelete(peopleContact);
            return peopleContactDelete;
        }
Esempio n. 24
0
        /// <summary>
        /// Creates the events after business info participated.
        /// </summary>
        /// <param name="peopleContact">The people contact.</param>
        /// <param name="calendar">The calendar.</param>
        /// <returns>Task.</returns>
        private void CreateEventsAfterBusinessInfoParticipatedAsync(PeopleContact peopleContact, Calendar calendar)
        {
            CreateEventsAfterBusinessInfoParticipated(peopleContact);

            if (calendar.UseGoogleCalendar && !calendar.Authorized)
                return;

            var events = new Event[1];
            DateTime startDate = peopleContact.BusinessInfoParticipated.GetValueOrDefault(DateTime.Today).AddDays(2);
            events[0] = new Event
            {
                Start = new EventDateTime { DateTime = startDate },
                End = new EventDateTime { DateTime = startDate.AddDays(3) },
                Summary = String.Format(GoogleCalendarResource.PeopleContactController_CreateEventsAfterBusinessInfoParticipatedAsync_Summary, peopleContact.LastName, peopleContact.FirstName),
                Description = String.Format(GoogleCalendarResource.PeopleContactController_CreateEventsAfterBusinessInfoParticipatedAsync_Description, peopleContact.LastName, peopleContact.FirstName)
            };
            calendar.InsertEvents(events);
        }
Esempio n. 25
0
 public PeopleContactDetails(PeopleContact peopleContact)
 {
     PeopleContactId = peopleContact.PeopleContactId;
     FirstName = peopleContact.FirstName;
     LastName = peopleContact.LastName;
     Title = peopleContact.Title;
     City = peopleContact.City;
     District = DistrictDetails.GetModelView(peopleContact.District);
     PhoneNumberPrefix1 = PhoneNumberPrefixDetails.GetModelView(peopleContact.PhoneNumberPrefix1);
     PhoneNumberPrefix2 = PhoneNumberPrefixDetails.GetModelView(peopleContact.PhoneNumberPrefix2);
     PhoneNumber2 = peopleContact.PhoneNumber2;
     Email1 = peopleContact.Email1;
     Email2 = peopleContact.Email2;
     FirstContacted = peopleContact.FirstContacted;
     Presented = peopleContact.Presented;
     BusinessInfoParticipated = peopleContact.BusinessInfoParticipated;
     TeamMeetingParticipated = peopleContact.TeamMeetingParticipated;
     Registrated = peopleContact.Registrated;
     PremiumMembershipGranted = peopleContact.PremiumMembershipGranted;
     Potential = peopleContact.Potential;
     MobileApplicationInstalledAndTrained = peopleContact.MobileApplicationInstalledAndTrained;
     ContactDead = peopleContact.ContactDead;
     PhoneNumber1 = peopleContact.PhoneNumber1;
     Skype = peopleContact.Skype;
     TrackingEmailSent = peopleContact.TrackingEmailSent;
     SecondContacted = peopleContact.SecondContacted;
     SecondMeeting = peopleContact.SecondMeeting;
     SecondTrackingEmailSent = peopleContact.SecondTrackingEmailSent;
     ThirdMeeting = peopleContact.ThirdMeeting;
     LoyaltySystemExplained = peopleContact.LoyaltySystemExplained;
     AccessGranted = peopleContact.AccessGranted;
     MoneyToPurchaseAccountSended = peopleContact.MoneyToPurchaseAccountSended;
     AbleToPurchase = peopleContact.AbleToPurchase;
     AutoCashback = peopleContact.AutoCashback;
     ShoppingPlanBackSet = peopleContact.ShoppingPlanBackSet;
     OwnUnitsContained = peopleContact.OwnUnitsContained;
     Tasks = peopleContact.Tasks;
     Note = peopleContact.Note;
     LyonessId = peopleContact.LyonessId;
     WorkflowState = peopleContact.WorkflowState;
     SendVideo = !String.IsNullOrEmpty(peopleContact.Email1);
 }
Esempio n. 26
0
 public void CopyFrom(PeopleContact peopleContact)
 {
     Title = peopleContact.Title;
     LastName = peopleContact.LastName;
     FirstName = peopleContact.FirstName;
     City = peopleContact.City;
     PhoneNumber1 = peopleContact.PhoneNumber1;
     PhoneNumber2 = peopleContact.PhoneNumber2;
     Email1 = peopleContact.Email1;
     Email2 = peopleContact.Email2;
     Skype = peopleContact.Skype;
     PremiumMembershipGranted = peopleContact.PremiumMembershipGranted;
     LyonessId = peopleContact.LyonessId;
     Tasks = peopleContact.Tasks;
     Note = peopleContact.Note;
 }
Esempio n. 27
0
        /// <summary>
        /// Processes the duplicity.
        /// </summary>
        /// <param name="peopleContacts">The people contacts.</param>
        private void ProcessDuplicity(PeopleContact[] peopleContacts)
        {
            if (!peopleContacts.Any())
                return;

            foreach (PeopleContact peopleContact in peopleContacts)
            {
                string email = String.IsNullOrEmpty(peopleContact.Registrar.Email1)
                                   ? peopleContact.Registrar.Email2
                                   : peopleContact.Registrar.Email1;
                if (String.IsNullOrEmpty(email))
                    continue;

                string textBody = String.Format(peopleContact.Registrated.HasValue
                                                    ? MailResource.PeopleContactController_ProcessDuplicityAndGetStatusMessage_IsRegistrated_TextBody
                                                    : MailResource.PeopleContactController_ProcessDuplicityAndGetStatusMessage_IsNotRegistrated_TextBody,
                                                peopleContact.FirstName, peopleContact.LastName);
                Mail.SendEmail(email, MailResource.PeopleContactController_ProcessDuplicityAndGetStatusMessage_Subject, textBody, peopleContact.Registrar.UseMail, true);
            }
        }