Example #1
0
        public CsvPeopleContact(DataRow dataRow, PhoneNumberPrefix[] phoneNumberPrefixes)
        {
            _dataRow = dataRow;
            _phoneNumberPrefixes = phoneNumberPrefixes;
            Data = new CsvPeopleContactData();

            IsValid = true;

            string additionalErrorMessage = ValidateRequiredFields();

            if (!IsValid)
            {
                ErrorMessage = String.Format(GetErrorTemplate(), additionalErrorMessage);
                return;
            }

            Data.FirstName = _dataRow[FirstNameColumnName].ToString();
            Data.LastName = _dataRow[LastNameColumnName].ToString();
            Data.Email1 = _dataRow[EmailColumnName].ToString().ToLower();

            additionalErrorMessage = ParseMobilePhone();

            if (!IsValid)
            {
                ErrorMessage = String.Format(GetErrorTemplate(), additionalErrorMessage);
            }
        }
        public static PhoneNumberPrefixDetails GetModelView(PhoneNumberPrefix phoneNumberPrefix)
        {
            if (phoneNumberPrefix == null)
                return null;

            var numberPrefixDetails = new PhoneNumberPrefixDetails(phoneNumberPrefix);
            return numberPrefixDetails;
        }
 public PhoneNumberPrefixEdit(PhoneNumberPrefix phoneNumberPrefix)
 {
     PhoneNumberPrefixId = phoneNumberPrefix.PhoneNumberPrefixId;
     Title = phoneNumberPrefix.Title;
     MatchRegex = phoneNumberPrefix.MatchRegex;
     ReplaceRegex = phoneNumberPrefix.ReplaceRegex;
     ExportablePrefix = phoneNumberPrefix.ExportablePrefix;
 }
Example #4
0
 private static void FixPhoneNumberPrefixes(ref DbSet<PhoneNumberPrefix> phoneNumberPrefixSet)
 {
     var phoneNumberPrefixe = new PhoneNumberPrefix
     {
         PhoneNumberPrefixId = 1,
         Title = "CZ +420",
         MatchRegex = "^(00420|420).*$",
         ReplaceRegex = "^(00420|420)",
         ExportablePrefix = "00420"
     };
     phoneNumberPrefixSet.AddOrUpdate(phoneNumberPrefixe);
 }
        public static PhoneNumberPrefixIndex[] GetModelView(PhoneNumberPrefix[] phoneNumberPrefixes)
        {
            if (phoneNumberPrefixes == null)
                return null;

            PhoneNumberPrefixIndex[] phoneNumberPrefixIndices = phoneNumberPrefixes.Select(pnp => new PhoneNumberPrefixIndex(pnp)).ToArray();
            return phoneNumberPrefixIndices;
        }
 public PhoneNumberPrefixDetails(PhoneNumberPrefix phoneNumberPrefix)
 {
     Title = phoneNumberPrefix.Title;
 }
 public PhoneNumberPrefixIndex(PhoneNumberPrefix phoneNumberPrefix)
 {
     PhoneNumberPrefixId = phoneNumberPrefix.PhoneNumberPrefixId;
     Title = phoneNumberPrefix.Title;
 }
 public PhoneNumberPrefix GetModel()
 {
     var phoneNumberPrefix = new PhoneNumberPrefix
                                 {
                                     PhoneNumberPrefixId = PhoneNumberPrefixId,
                                     Title = Title,
                                     MatchRegex = MatchRegex,
                                     ReplaceRegex = ReplaceRegex,
                                     ExportablePrefix = ExportablePrefix,
                                 };
     return phoneNumberPrefix;
 }
        public static PhoneNumberPrefixEdit GetModelView(PhoneNumberPrefix phoneNumberPrefix)
        {
            if (phoneNumberPrefix == null)
                return null;

            var phoneNumberPrefixEdit = new PhoneNumberPrefixEdit(phoneNumberPrefix);
            return phoneNumberPrefixEdit;
        }