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(); }
public List <BusinessLogicLayer> GetAllSuppliers() { tblSuppliers = adpSuppliers.GetSuppliers(); if (tblSuppliers.Count > 0) { listSuppliers = new List <BusinessLogicLayer>(); foreach (var row in tblSuppliers) { BusinessLogicLayer supplier = new BusinessLogicLayer(); supplier.Id = row.SupplierID; supplier.Name = row.CompanyName; listSuppliers.Add(supplier); } } return(listSuppliers); }
public virtual NorthwindDataSet.SuppliersDataTable GetData() { this.Adapter.SelectCommand = this.CommandCollection[0]; NorthwindDataSet.SuppliersDataTable dataTable = new NorthwindDataSet.SuppliersDataTable(); this.Adapter.Fill(dataTable); return dataTable; }