示例#1
0
 public static void Add(EmployeeDTO e)
 {
     DataClasses1DataContext context = new DataClasses1DataContext();
     Employee emp = Converter.EmployeeDTOtoEmp(e);
     context.Employees.InsertOnSubmit(emp);
     context.SubmitChanges();
 }
示例#2
0
        public static List<EmployeeDTO> GetEmployee()
        {
            DataClasses1DataContext context = new DataClasses1DataContext();

            var result = from r in context.Employees select r;
            List<EmployeeDTO> lstEmpDto = Converter.LstEmpToLstEmpDTO( result.ToList());
            return lstEmpDto;
        }