Exemplo n.º 1
0
        //------------------------------------------------------------------------------------------------------------------------------------------
        public List <DTO.CategoryDTO> SelectAllCategoryByDataReader()
        {
            List <DTO.CategoryDTO> list = new List <DTO.CategoryDTO>();
            string        strCmd        = "select_all_category";
            SqlDataReader rd            = _DataProvicer.ExecuteQueryWithDataReader(strCmd, CommandType.StoredProcedure);

            if (rd.HasRows)
            {
                while (rd.Read())
                {
                    DTO.CategoryDTO dto = new DTO.CategoryDTO
                    {
                        CategoryID   = rd.GetString(0),
                        CategoryName = rd.GetString(1),
                    };
                    list.Add(dto);
                }
            }
            return(list);
        }