public void AddPerson(Person person) { using (var context = new DPADataContext()) { context.Persons.InsertOnSubmit(person); context.SubmitChanges(); } }
public void AddDepartment(Department department) { using (var context = new DPADataContext()) { context.Departments.InsertOnSubmit(department); context.SubmitChanges(); } }
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(); } }