Exemple #1
0
        public void UpdateContactRecord(dbContact record)
        {
            var entity = Contacts.Find(record.Id);

            entity.Full_Name         = record.Full_Name;
            entity.Avatar            = record.Avatar;
            entity.Country           = record.Country;
            entity.Created_At        = record.Created_At;
            entity.DeviceFingerPrint = record.DeviceFingerPrint;
            entity.Email             = record.Email;
            entity.Phone_Number      = record.Phone_Number;
            entity.Web_Site          = record.Web_Site;
            entity.Zip_Code          = record.Zip_Code;
            Contacts.Update(entity);
            SaveChanges();
        }
Exemple #2
0
        public List <dbContact> DoSearchQuery(dbContact criteria)
        {
            List <dbContact> outlist = new List <dbContact>();

            foreach (dbContact cnt in Contacts)
            {
                if (criteria == null || (cnt.Full_Name != null && cnt.Full_Name.Contains(criteria.Full_Name, StringComparison.InvariantCultureIgnoreCase)))
                {
                    if (criteria == null || (cnt.Zip_Code != null && cnt.Zip_Code.Contains(criteria.Zip_Code, StringComparison.InvariantCultureIgnoreCase)))
                    {
                        if (criteria == null || (cnt.Country != null && cnt.Country.Contains(criteria.Country, StringComparison.InvariantCultureIgnoreCase)))
                        {
                            outlist.Add(cnt);
                        }
                    }
                }
            }
            ContactPresentation = outlist;
            return(outlist);
        }
Exemple #3
0
 public void AddContactRecord(dbContact record)
 {
     Contacts.Add(record);
     SaveChanges();
 }