Пример #1
0
        //显示数据
        public static List <T_Employee> GetList()
        {
            string            sql   = "select * from T_Employee";
            DataTable         table = DBhelp.Read(sql);
            List <T_Employee> lst   = new List <T_Employee>();

            foreach (DataRow row in table.Rows)
            {
                T_Employee emp = new T_Employee
                {
                    EmployeeId   = Convert.ToInt32(row["EmployeeId"]),
                    EmployeeName = row["EmployeeName"].ToString(),
                    ImageUrl     = row["ImageUrl"].ToString(),
                    DeptId       = Convert.ToInt32(row["DeptId"]),
                    Sex          = row["Sex"].ToString(),
                    Age          = Convert.ToInt32(row["Age"])
                };
                lst.Add(emp);
            }
            return(lst);
        }
Пример #2
0
        //查询下拉列表中的列表
        public static DataTable GetListTable()
        {
            string sql = "select * from T_Employee join T_Dept on T_Employee.DeptId=T_Dept.DeptId";

            return(DBhelp.Read(sql));
        }
Пример #3
0
        public static DataTable Getlist()
        {
            string sql = "select * from T_Dept";

            return(DBhelp.Read(sql));
        }