Esempio n. 1
0
        public List <AreaModel> GetAreaInfo()
        {
            System.Diagnostics.Debug.WriteLine("here333");
            SalesERPDAL salesDal = new SalesERPDAL();

            return(salesDal.AreaInfo.ToList());
        }
 public IEnumerable <Employee> Querys(string searchString)
 {
     using (SalesERPDAL dal = new SalesERPDAL())
     {
         return(dal.Employees.Where(e => e.Name.Contains(searchString)).ToList());
     }
 }
 public IEnumerable <Employee> Select(string name)
 {
     using (var db = new SalesERPDAL())
     {
         return(db.MyEmployees.Where(e => e.Name.Contains(name)).ToList());
     }
 }
Esempio n. 4
0
        public List <Employee> GetEmployeeList()
        {
            SalesERPDAL dal  = new SalesERPDAL();
            var         list = dal.Employee.ToList();

            return(list);
        }
        public List<Employee> GetEmployees()
        {
            SalesERPDAL sdal = new SalesERPDAL();
            return sdal.employees.ToList();

            //List<Employee> emplist = new List<Employee>();
            //Employee emp1 = new Employee();
            //Employee emp2 = new Employee();
            //Employee emp3 = new Employee();
            //emp1.FirstName = "Vikas";
            //emp1.LastName = "Pinnuri";
            //emp1.Salary = 10000;
            //emplist.Add(emp1);

            //emp2.FirstName = "Siva";
            //emp2.LastName = "Chamarthi";
            //emp2.Salary = 20000;
            //emplist.Add(emp2);

            //emp3.FirstName = "Praveen";
            //emp3.LastName = "Rajuri";
            //emp3.Salary = 30000;
            //emplist.Add(emp3);

            //return emplist;
        }
 public bool SetAdmin(Employee e)
 {
     try
     {
         if (e.Authentication == 1)
         {
             return(true);
         }
         using (SalesERPDAL salesERPDAL = new SalesERPDAL())
         {
             foreach (var v in salesERPDAL.Employees)
             {
                 if (e.UserID == v.UserID)
                 {
                     v.Authentication = 1;
                 }
                 else
                 {
                     v.Authentication = 0;
                 }
             }
             salesERPDAL.SaveChanges();
             return(true);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Esempio n. 7
0
        public List <Employee> GetEmployees()
        {
            SalesERPDAL salesDal = new SalesERPDAL();

            return(salesDal.Employees.ToList());


            var      employees = new List <Employee>();
            Employee emp       = new Employee();

            emp.FirstName = "johnson";
            emp.LastName  = "fernandes";
            emp.Salary    = 140000;
            employees.Add(emp);



            Employee emp1 = new Employee();

            emp1.FirstName = "johnson1";
            emp1.LastName  = "fernandes1";
            emp1.Salary    = 1400001;
            employees.Add(emp1);

            Employee emp2 = new Employee();

            emp2.FirstName = "johnson2";
            emp2.LastName  = "fernandes2";
            emp2.Salary    = 1400001;
            employees.Add(emp2);

            return(employees);
        }
Esempio n. 8
0
        public List <Employee> GetEmployees()
        {
            /*	List<Employee> employees = new List<Employee>();
             *      Employee emp = new Employee();
             *      emp.FirstName = "Johnson";
             *      emp.LastName = "Fernandes";
             *      emp.Salary = 14000;
             *      employees.Add(emp);
             *
             *      emp = new Employee();
             *      emp.FirstName = "Michael";
             *      emp.LastName = "Jackson";
             *      emp.Salary = 16000;
             *      employees.Add(emp);
             *
             *      emp = new Employee();
             *      emp.FirstName = "Robert";
             *      emp.LastName = "Pattinson";
             *      emp.Salary = 20000;
             *      employees.Add(emp);
             *
             *      return employees;*/

            return(SalesERPDAL.GetEmployees());
        }
Esempio n. 9
0
        public List <Employee> GetEmployee()
        {
            //List<Employee> employees = new List<Employee>();
            //Employee emp = new Employee();
            //emp.Name = "阿1";
            //emp.Salary = 20000;
            //employees.Add(emp);

            //emp = new Employee();
            //emp.Name = "阿2";
            //emp.Salary = 10000;
            //employees.Add(emp);


            //emp = new Employee();
            //emp.Name = "阿3";
            //emp.Salary = 2000;
            //employees.Add(emp);

            //return employees;

            //SalesERPDAL salesDal = new SalesERPDAL();
            //return salesDal.Employees.ToList();

            using (SalesERPDAL dal = new SalesERPDAL())
            {
                var list = dal.Employees.ToList();
                return(list);
            }
        }
        public List <Employee> GetEmployees()
        {
            #region Using the list to return the data
            //List<Employee> employees = new List<Employee>();

            //Employee emp = new Employee();
            //emp.FirstName = "Sabique";
            //emp.LastName = "Khan";
            //emp.Salary = 10000;
            //employees.Add(emp);

            //emp = new Employee();
            //emp.FirstName = "John";
            //emp.LastName = "Doe";
            //emp.Salary = 50000;
            //employees.Add(emp);

            //emp = new Employee();
            //emp.FirstName = "Jenny";
            //emp.LastName = "Doe";
            //emp.Salary = 60000;
            //employees.Add(emp);

            //return employees;
            #endregion

            #region Returning the data from the database
            SalesERPDAL salesDAL = new SalesERPDAL();
            return(salesDAL.Employees.ToList());

            #endregion
        }
Esempio n. 11
0
        public List<Employee> GetEmployees()
        {
            SalesERPDAL salesDal = new SalesERPDAL();
            return salesDal.Employees.ToList();




            //var list = new List<Employee>();
            //Employee emp = new Employee();
            //emp.Name = "张三";
            //emp.Salary = 10000;

            //list.Add(emp);

            //emp = new Employee();
            //emp.Name = "李四";
            //emp.Salary = 100000;

            //list.Add(emp);

            //emp = new Employee();
            //emp.Name = "王五";
            //emp.Salary = 100000;

            //list.Add(emp);
            //return list;
        }
        public List <Employee> GetEmployees()
        {
            //return MockData();
            SalesERPDAL dal = new SalesERPDAL();

            return(dal.Employees.ToList());
        }
        public void SaveEmployee(Employee e)
        {
            SalesERPDAL salesDal = new SalesERPDAL();

            salesDal.Employees.Add(e);
            salesDal.SaveChanges();
        }
        public EmployeeListViewFromDBModel(string userName)
        {
            SalesERPDAL salesDal = new SalesERPDAL();

            GetEmployeesFromDB();
            this.UserName = userName;
        }
Esempio n. 15
0
        public void UploadEmployeesRegionInfo(List <AreaModel> areaInfo)
        {
            SalesERPDAL salesDal = new SalesERPDAL();

            salesDal.AreaInfo.AddRange(areaInfo);
            salesDal.SaveChanges();
        }
Esempio n. 16
0
        public List <Employee> GetEmployees()
        {
            SalesERPDAL salesDal = new SalesERPDAL();

            return(salesDal.Employees.ToList());

            /*List<Employee>  employees = new List<Employee> ();
             * Employee emp = new Employee();
             * emp.FirstName = "johnson";
             * emp.LastName = " fernandes";
             * emp.Salary = 14000;
             * employees.Add(emp);
             *
             * emp = new Employee();
             * emp.FirstName = "michael";
             * emp.LastName = "jackson";
             * emp.Salary = 16000;
             * employees.Add(emp);
             *
             * emp = new Employee();
             * emp.FirstName = "robert";
             * emp.LastName = " pattinson";
             * emp.Salary = 20000;
             * employees.Add(emp);
             *
             * return employees;*/
        }
        public List <Employee> GetEmployees()
        {
            //List<Employee> employees = new List<Employee>();

            //Employee emp = new Employee();
            //emp.FirstName = "Johnson";
            //emp.LastName = "Fernandes";
            //emp.Salary = 120000;

            //employees.Add(emp);

            //Employee emp2 = new Employee
            //{
            //    FirstName = "Mark",
            //    LastName = "Raduenzel",
            //    Salary = 200000
            //};

            //employees.Add(emp2);

            //return employees;

            SalesERPDAL sales = new SalesERPDAL();

            return(sales.Employees.ToList());
        }
Esempio n. 18
0
        public List <Employee> GetEmployees()
        {
            SalesERPDAL sales = new SalesERPDAL();


            return(sales.Employees.ToList());
        }
Esempio n. 19
0
        //public List<Employee> GetEmployees()
        //{
        //    List<Employee> employees = new List<Employee>();
        //    Employee emp = new Employee();
        //    emp.FirstName = "johnson";
        //    emp.LastName = " fernandes";
        //    emp.Salary = 14000;
        //    employees.Add(emp);

        //    emp = new Employee();
        //    emp.FirstName = "michael";
        //    emp.LastName = "jackson";
        //    emp.Salary = 16000;
        //    employees.Add(emp);

        //    emp = new Employee();
        //    emp.FirstName = "robert";
        //    emp.LastName = " pattinson";
        //    emp.Salary = 20000;
        //    employees.Add(emp);

        //    return employees;
        //}
        // 获得数据库Employee数据
        public List <Employee> GetEmployees()
        {
            SalesERPDAL salesDal = new SalesERPDAL();

            // 将全部Employee转为List
            return(salesDal.Employees.ToList());
        }
Esempio n. 20
0
        public void UploadEmployees(List <Employee> employees)
        {
            var salesDal = new SalesERPDAL();

            salesDal.Employees.AddRange(employees);
            salesDal.SaveChanges();
        }
Esempio n. 21
0
        public List <Employee> GetEmployeeList()
        {
            using (SalesERPDAL salesDal = new SalesERPDAL())
            {
                var list = salesDal.Employees.ToList();
                //return salesDal.Employees.ToList();
                return(list);
            }


            //var list = new List<Employee>();

            //Employee emp = new Employee();
            //emp.Name = "杨";
            //emp.Salary = 15000;
            //list.Add(emp);

            //emp = new Employee();
            //emp.Name = "天";
            //emp.Salary = 2000;
            //list.Add(emp);

            //emp = new Employee();
            //emp.Name = "敏";
            //emp.Salary = 2500;
            //list.Add(emp);

            //return list;
        }
Esempio n. 22
0
 public Employee Query(int id)
 {
     using (SalesERPDAL dal = new SalesERPDAL())
     {
         return(dal.Employee.Find(id));
     }
 }
Esempio n. 23
0
        public void UploadEmployees(List <Employee> employees)
        {
            SalesERPDAL salesDAL = new SalesERPDAL();

            salesDAL.Employees.AddRange(employees);
            salesDAL.SaveChanges();
        }
Esempio n. 24
0
        //员工信息业务层
        public List <Employee> GetEmployeesList()
        {
            //SalesERPDAL salesDal = new SalesERPDAL();
            //return salesDal.Employee.ToList();
            using (SalesERPDAL dal = new SalesERPDAL())
            {
                var list = dal.Employee.ToList();
                return(list);
            }



            //List<Employee> employeesList = new List<Employee>();

            //Employee emp = new Employee();
            //emp.Name = "张三";
            //emp.Salary = 500;
            //employeesList.Add(emp);

            //emp = new Employee();
            //emp.Name = "张四";
            //emp.Salary = 1200;
            //employeesList.Add(emp);

            //emp = new Employee();
            //emp.Name = "李三";
            //emp.Salary = 1600;
            //employeesList.Add(emp);

            //return employeesList;
        }
Esempio n. 25
0
 public IEnumerable <Employee> Search(string searchStirng)
 {
     using (var db = new SalesERPDAL())
     {
         return(db.Employees.Where(e => e.Name.Contains(searchStirng)).ToList());
     }
 }
        public List <Empleado> GetEmpleados()
        {
            //List<Empleado> Empleados = new List<Empleado>();
            //Empleado emp = new Empleado();
            //emp.FirstName = "Jonh";
            //emp.LastName = "Doe";
            //emp.Salario = 178000;
            //Empleados.Add(emp);

            //emp = new Empleado();
            //emp.FirstName = "Michael";
            //emp.LastName = "Jackson";
            //emp.Salario = 10000000;
            //Empleados.Add(emp);

            //emp = new Empleado();
            //emp.FirstName = "Mariel";
            //emp.LastName = "Rodríguez";
            //emp.Salario = 10000;
            //Empleados.Add(emp);

            SalesERPDAL salesDal = new SalesERPDAL();

            return(salesDal.empleados.ToList());
        }
Esempio n. 27
0
        public List <employee> GetEmployees()
        {
            SalesERPDAL salesDal = new SalesERPDAL();

            return(salesDal.Employees.ToList());
            //List<employee> employees = new List<employee>();
            //employee emp = new employee();
            //emp.FirstName = "johnson";
            //emp.LastName = " fernandes";
            //emp.Salary = 14000;
            //employees.Add(emp);

            //emp = new employee();
            //emp.FirstName = "michael";
            //emp.LastName = "jackson";
            //emp.Salary = 1600000;
            //employees.Add(emp);

            //emp = new employee();
            //emp.FirstName = "robert";
            //emp.LastName = " pattinson";
            //emp.Salary = 20000;
            //employees.Add(emp);

            //emp = new employee();
            //emp.FirstName = "jack";
            //emp.LastName = " sparrow";
            //emp.Salary = 2000;
            //employees.Add(emp);

            //return employees;
        }
Esempio n. 28
0
 public Employee SaveEmployee(Employee e)
 {
     SalesERPDAL salesDal = new SalesERPDAL();
     salesDal.Employees.Add(e);
     salesDal.SaveChanges();
     return e;
 }
Esempio n. 29
0
 //更新
 public void UpdateSaveEmployee(Employee emp)
 {
     using (SalesERPDAL dal = new SalesERPDAL())
     {
         dal.Entry(emp).State = EntityState.Modified;
         dal.SaveChanges();
     }
 }
Esempio n. 30
0
 //更新方法
 public void Update(Employee emp)
 {
     using (var db = new SalesERPDAL())
     {
         db.Entry(emp).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Esempio n. 31
0
 //查询方法
 public Employee Query(int id)
 {
     using (var db = new SalesERPDAL())
     {
         Employee emp = db.Employees.Find(id);
         return(emp);
     }
 }
Esempio n. 32
0
 public List <Employee> GetEmployeeList()
 {
     using (SalesERPDAL dal = new SalesERPDAL())
     {
         var list = dal.Employees.ToList();
         return(list);
     }
 }
Esempio n. 33
0
 public void UploadEmployees(List<Employee> employees)
 {
     SalesERPDAL salesDal = new SalesERPDAL();
     salesDal.Employees.AddRange(employees);
     salesDal.SaveChanges();
 }
Esempio n. 34
0
 public List<Employee> GetEmployees()
 {
     SalesERPDAL salesDal = new SalesERPDAL();
     return salesDal.Employees.ToList();
 }