コード例 #1
0
        public DataAccessLayer()
        {
            adpCategories = new NorthwindDataSetTableAdapters.CategoriesTableAdapter();
            tblCategories = new NorthwindDataSet.CategoriesDataTable();

            adpSuppliers = new NorthwindDataSetTableAdapters.SuppliersTableAdapter();
            tblSuppliers = new NorthwindDataSet.SuppliersDataTable();

            adpProducts = new NorthwindDataSetTableAdapters.ProductsTableAdapter();
            tblProducts = new NorthwindDataSet.ProductsDataTable();
        }
コード例 #2
0
 public List <BusinessLogicLayer> GetAllCategories()
 {
     tblCategories = adpCategories.GetCategories();
     if (tblCategories.Count > 0)
     {
         listCategories = new List <BusinessLogicLayer>();
         foreach (var row in tblCategories)
         {
             BusinessLogicLayer category = new BusinessLogicLayer();
             category.Id   = row.CategoryID;
             category.Name = row.CategoryName;
             listCategories.Add(category);
         }
     }
     return(listCategories);
 }
コード例 #3
0
 public virtual NorthwindDataSet.CategoriesDataTable GetData() {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     NorthwindDataSet.CategoriesDataTable dataTable = new NorthwindDataSet.CategoriesDataTable();
     this.Adapter.Fill(dataTable);
     return dataTable;
 }