private void CheckEmailAddress(string[] record, ContactModel model) { if (string.IsNullOrWhiteSpace(model.Email)) { string noWeeklyEmail = GetStringFromRecord(POSNWEMAIL, record); if (!string.IsNullOrWhiteSpace(noWeeklyEmail)) { model.Email = noWeeklyEmail; model.ReceiveWeekly = false; } } }
private ContactModel ParseSingleRecord(Gender gender, string[] record) { ContactModel model = new ContactModel() { LastName = GetStringFromRecord(POSLASTNAME, record), FirstName = GetStringFromRecord(POSFIRSTNAME, record), StreetAddress = GetStringFromRecord(POSADDRESS, record), City = GetStringFromRecord(POSCITY, record), State = GetStringFromRecord(POSSTATE, record), Zip = GetStringFromRecord(POSZIP, record), Email = gender == Gender.MALE ? GetStringFromRecord(POSMEMAIL, record) : GetStringFromRecord(POSFEMAIL, record), ContactGender = gender, HomePhone = GetStringFromRecord(POSHOMEPHONE, record), CellPhone = GetStringFromRecord(POSCELLPHONE, record), ReceiveWeekly = true }; CheckEmailAddress(record, model); return model; }