public CategoryProducts CategoryProductsSelectRow(int categoryId) { var select = new DAL.CategoryProduct.CategoryProducts(); DbDataReader dr = select.CategoryProductsSelectRow(categoryId); var categoryProduct = new CategoryProducts(); if (dr.Read()) { categoryProduct.categoryId = (int)dr["CategoryId"]; categoryProduct.categoryName = (string)dr["CategoryName"]; } return(categoryProduct); }
public List <CategoryProducts> CategoryProductsSelectAll() { var select = new DAL.CategoryProduct.CategoryProducts(); var categoryProducts = new List <CategoryProducts>(); DbDataReader dr = select.CategoryProductsSelectAll(); while (dr.Read()) { var myCategoryProducts = new CategoryProducts { categoryId = (int)dr["CategoryId"], categoryName = (string)dr["CategoryName"] }; categoryProducts.Add(myCategoryProducts); } return(categoryProducts); }