public Employee SaveEmployee(Employee e) { var salesDal = new SalesERPDAL(); salesDal.Employees.Add(e); salesDal.SaveChanges(); return e; }
public List<Employee> GetEmployees() { #region //List<Employee> employees = new List<Employee>(); //Employee emp = new Employee(); //emp.FirstName = "john"; //emp.LastName = "fernado"; //emp.Salary = 14000; //employees.Add(emp); //emp = new Employee(); //emp.FirstName = "Kate"; //emp.LastName = "Machal"; //emp.Salary = 16000; //employees.Add(emp); //emp = new Employee(); //emp.FirstName = "rebort"; //emp.LastName = "jackson"; //emp.Salary = 24000; //employees.Add(emp); #endregion SalesERPDAL salesDal = new SalesERPDAL(); List<Employee> employees = new List<Employee>(); try { return salesDal.Employees.ToList(); } catch { return employees; } }
public Employee SaveEmployee(Employee e) { SalesERPDAL salesDal = new SalesERPDAL(); try { salesDal.Employees.Add(e); salesDal.SaveChanges(); } catch (Exception) { } return e; }
public void UploadEmployees(List<Employee> employees) { SalesERPDAL salesDal = new SalesERPDAL(); salesDal.Employees.AddRange(employees); salesDal.SaveChanges(); }
public List<Employee> GetEmployees() { var salesDal = new SalesERPDAL(); return salesDal.Employees.ToList(); }