コード例 #1
0
        //Lay tat ca nhung nhan vien (Bao gom dang ton tai va da xoa)
        public List <Employees> GetAll()
        {
            List <Employees> listct = new List <Employees>();
            string           sql    = "SELECT * FROM Employees ORDER BY CreatedOn DESC";
            SqlDataReader    dr     = _helper.ExcuteDataReader(sql, null, CommandType.Text);

            listct = _helper.MapReaderToList <Employees>(dr);
            _helper.DisConnect();
            return(listct);
        }
コード例 #2
0
        //Lay tat ca nhung nguoi dung (Bao gom dang ton tai va da xoa)
        public List <Users> GetAll()
        {
            List <Users>  listct = new List <Users>();
            string        sql    = "SELECT u.*, e.FullName FROM Users u JOIN Employees e ON u.ID = e.EmpID ORDER BY u.CreatedOn DESC";
            SqlDataReader dr     = _helper.ExcuteDataReader(sql, null, CommandType.Text);

            listct = _helper.MapReaderToList <Users>(dr);
            _helper.DisConnect();
            return(listct);
        }