コード例 #1
0
        //public DataTable getDataToFilGrid()
        //{
        //    DataAccessWorkplace objDataAccessWorkplace = new DataAccessWorkplace();
        //    objDataAccessWorkplace.getDataToDataGrid();

        //    return objDataAccessWorkplace.getDataToDataGrid();
        //}

        public List <Employee> GetEmployee()
        {
            DataAccessWorkplace objDataAccessWorkplace = new DataAccessWorkplace();
            DataTable           dt = new DataTable();

            dt = objDataAccessWorkplace.getDataToDataGrid();

            List <Employee> lstEmployee = new List <Employee>();

            foreach (DataRow dr in dt.Rows)
            {
                Employee ObjEmployee = new Employee
                {
                    EmpID         = Convert.ToInt32(dr["EmpID"]),
                    EmpName       = dr["EmpName"].ToString(),
                    Designation   = dr["Designation"].ToString(),
                    objDepartment = new Department()
                    {
                        DeptId         = Convert.ToInt32(dr["DeptID"]),
                        DepartmentName = dr["DeptName"].ToString()
                    },
                };
                lstEmployee.Add(ObjEmployee);
            }

            return(lstEmployee);
        }
コード例 #2
0
        public List <Department> GetDepartment()
        {
            try
            {
                DataAccessWorkplace objDataAccessWorkplace = new DataAccessWorkplace();
                DataTable           dt = new DataTable();

                List <Department> lstDepartment = new List <Department>();

                dt = objDataAccessWorkplace.getDataToDeptCmb();

                foreach (DataRow dr in dt.Rows)
                {
                    Department ObjDepartment = new Department
                    {
                        DeptId         = Convert.ToInt32(dr["DeptID"]),
                        DepartmentName = dr["DeptName"].ToString()
                    };
                    lstDepartment.Add(ObjDepartment);
                }
                return(lstDepartment);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
        public bool Login(userLogin objuserLogin)
        {
            DataAccessWorkplace objDataAccessWorkplace = new DataAccessWorkplace();

            return(objDataAccessWorkplace.GetUserlogin(objuserLogin));
        }
コード例 #4
0
        public void insertEmployee(Employee object1)
        {
            DataAccessWorkplace objDataAccessWorkplace = new DataAccessWorkplace();

            objDataAccessWorkplace.insertEmployee(object1);
        }