コード例 #1
0
 public Employee SaveEmployee(Employee e)
 {
     var salesDal = new SalesERPDAL();
     salesDal.Employees.Add(e);
     salesDal.SaveChanges();
     return e;
 }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 public Employee SaveEmployee(Employee e)
 {
     SalesERPDAL salesDal = new SalesERPDAL();
     try
     {
         salesDal.Employees.Add(e);
         salesDal.SaveChanges();
     }
     catch (Exception)
     {
     }
     return e;
 }
コード例 #4
0
 public void UploadEmployees(List<Employee> employees)
 {
     SalesERPDAL salesDal = new SalesERPDAL();
     salesDal.Employees.AddRange(employees);
     salesDal.SaveChanges();
 }
コード例 #5
0
 public List<Employee> GetEmployees()
 {
     var salesDal = new SalesERPDAL();
     return salesDal.Employees.ToList();
 }