Example #1
0
        public void ImportFromCommaDelimited(string inputText)
        {
            var sw             = new StringReader(inputText);
            var splitCharacter = ",";
            var lineToProcess  = string.Empty;

            lineToProcess = sw.ReadLine();

            while (lineToProcess != null)
            {
                var lineValues = lineToProcess.Split(splitCharacter.ToCharArray());
                if (lineValues.Length > 0)
                {
                    var mm = new MailingListMember();
                    mm.EmailAddress = lineValues[0];
                    mm.ListId       = Id;
                    if (lineValues.Length > 1)
                    {
                        mm.LastName = lineValues[1];
                    }
                    if (lineValues.Length > 2)
                    {
                        mm.FirstName = lineValues[2];
                    }
                    Members.Add(new MailingListMember
                    {
                        LastName     = mm.LastName,
                        FirstName    = mm.FirstName,
                        EmailAddress = mm.EmailAddress
                    });
                }
                lineToProcess = sw.ReadLine();
            }
            sw.Dispose();
        }
 public bool UpdateMemberOnly(MailingListMember m)
 {
     return(memberRepository.Update(m));
 }
 public bool CreateMemberOnly(MailingListMember m)
 {
     m.StoreId = Context.CurrentStore.Id;
     return(memberRepository.Create(m));
 }