public static List <ContactData> GetAll() { using (AddressbookDB db = new AddressbookDB()) { return((from c in db.Contacts.Where(x => x.Deprecated == "0000-00-00 00:00:00") select c).ToList()); } }
public static List <GroupData> GetAll() { using (AddressbookDB db = new AddressbookDB()) { return((from g in db.Groups select g).ToList()); } }
public static List <GroupContactRelation> GetAll() { using (AddressbookDB db = new AddressbookDB()) { return((from gcr in db.GCR select gcr).ToList()); } }
public int GetCountContacts() { using (AddressbookDB db = new AddressbookDB()) { return((from c in db.Contacts.Where(x => x.Deprecated == "0000-00-00 00:00:00") select c).Count()); } }
public List <ContactData> GetContacts() { using (AddressbookDB db = new AddressbookDB()) { return((from c in db.Contacts from gcr in db.GCR.Where(p => p.GroupId == Id && p.ContactId == c.Id && c.Deprecated == "0000-00-00 00:00:00") select c).Distinct().ToList()); } }
public int CountContactsInGroups() { using (AddressbookDB db = new AddressbookDB()) { return((from c in db.Contacts from gcr in db.GCR.Where(p => p.GroupId == Id && p.ContactId == c.Id && c.Deprecated == "0000-00-00 00:00:00") select c).Count()); } }
public List <GroupData> GetGroups() { using (AddressbookDB db = new AddressbookDB()) { List <GroupData> groups = (from g in db.Groups from gcr in db.GCR.Where(p => p.ContactId == Id && p.GroupId == g.Id) select g) .Distinct().ToList(); return(groups); } }