예제 #1
0
 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());
     }
 }
예제 #2
0
 public static List <GroupData> GetAllFromDB()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Groups select g).ToList());
     }
 }
예제 #3
0
 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.DateTo == "0000-00-00 00:00:00") select c).Distinct().ToList());
     }
 }
예제 #4
0
 public static List <GroupData> GetAll()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Groups.Where(x => x.Deprecated == "0000-00-00 00:00:00") select g).ToList());
     }
 }
예제 #5
0
 public static List <ContactData> GetAll()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Contacts.Where(x => x.Active == "0000-00-00 00:00:00") select g).ToList());
     }
 }
예제 #6
0
 public List<ContactData> GetContactsWithGroup(string groupId)
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return (from c in db.Contacts from gcr in db.GCR.Where(p => p.GroupId == groupId && p.ContactId == c.Id && c.Deprecated == "0000-00-00 00:00:00") select c).Distinct().ToList();
     }
 }
예제 #7
0
파일: GroupData.cs 프로젝트: gureva/tests
 public static List <GroupData> GetAll()
 {
     //соединение и закрытие подключения автоматически
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Groups select g).ToList());
     }
 }
예제 #8
0
 public static List <GroupData> GetAll()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Groups select g).ToList());
         // db.Close(); не надо прописывать, т.к. автоматом закрывается
     }
 }
예제 #9
0
파일: ContactData.cs 프로젝트: gureva/tests
 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());
     }
 }
예제 #10
0
 public List <GroupContactRelation> GetRelations()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from gcr in db.GCR
                 select gcr).Distinct().ToList());
     }
 }
예제 #11
0
 public List <GroupData> GetGroups()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Groups
                 from gcr in db.GCR.Where(p => p.GroupId == g.Id && p.ContactId == Id && g.Deprecated == "0000-00-00 00:00:00")
                 select g).Distinct().ToList());
     }
 }
예제 #12
0
 public static List <GroupData> GetGroups()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Groups
                 from gcr in db.GCR.Where(p => p.Groupid == g.Id)
                 select g).Distinct().ToList());
     }
 }
예제 #13
0
 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") //проверяем, что контакт не удален
                 orderby c.Modified ascending                                            //сортируем по дате модификации, чтобы каждый раз модифицировался новый контакт
                 select c).ToList());
     }
 }