public Employee CreateEmployee(Employee employee)
 {
     var dc = new DataClassesDataContext(_connectionString);
     dc.Employees.InsertOnSubmit(employee);
     dc.SubmitChanges();
     return employee;
 }
 partial void DeleteEmployee(Employee instance);
 partial void UpdateEmployee(Employee instance);
 partial void InsertEmployee(Employee instance);
 public Employee UpdateEmployee(Employee employee)
 {
     var dc = new DataClassesDataContext(_connectionString);
     dc.Employees.Attach(employee, ReadEmployee(employee.EmployeeID));
     dc.SubmitChanges();
     return employee;
 }
 public Order[] SearchOrder(Employee employee, DateTime dateFrom, DateTime dateTo)
 {
     var dc = new DataClassesDataContext(_connectionString);
     IQueryable<Order> s = from e in dc.Orders
                           where (dateFrom == default(DateTime) || e.ShippedDate >= dateFrom)
                                 && (dateTo == default(DateTime) || e.ShippedDate < dateTo)
                                 && (employee == null || e.Employee == employee)
                           select e;
     return s.ToArray();
 }
 public void DeleteEmployee(Employee employee)
 {
     var dc = new DataClassesDataContext(_connectionString);
     IQueryable<Employee> s = from e in dc.Employees
                              where e.EmployeeID == employee.EmployeeID
                              select e;
     dc.Employees.DeleteOnSubmit(s.First());
     dc.SubmitChanges();
 }