Пример #1
0
 public void AddPerson(Person person)
 {
     using (var context = new DPADataContext())
     {
         context.Persons.InsertOnSubmit(person);
         context.SubmitChanges();
     }
 }
Пример #2
0
 public void AddDepartment(Department department)
 {
     using (var context = new DPADataContext())
     {
         context.Departments.InsertOnSubmit(department);
         context.SubmitChanges();
     }
 }
Пример #3
0
 public IList<Person> SearchPerson(string personName, string personalCodeNmr)
 {
     using (var context = new DPADataContext())
     {
         return context.Persons.Where(
             p =>
                 (string.IsNullOrEmpty(personName) || p.PersonName.Contains(personName)) &&
                 (string.IsNullOrEmpty(personalCodeNmr) || p.PersonalCodeNmr.Contains(personalCodeNmr))).ToList();
     }
 }