private static void ListInventory(InventoryDAL dal) { foreach (NewCar car in dal.GetAllInventoryAsList()) { Console.WriteLine("CarId: {0}, Make: {1}, Color: {2}, PetName: {3}", car.CarId, car.Make, car.Color, car.PetName); } Console.WriteLine(); }
static void ListInventoryAsList(InventoryDAL invDal) { Console.WriteLine("************* ListInventoryAsList *********"); List<NewCar> data = invDal.GetAllInventoryAsList(); foreach (NewCar c in data) { Console.WriteLine("CarID: {0}, Make: {1}, Color: {2}, PetName: {3}", c.CarID, c.Make, c.Color, c.PetName); } }
private static void ListInventoryViaList(InventoryDAL invDAL) { List<NewCar> record = invDAL.GetAllInventoryAsList(); foreach (NewCar c in record) { Console.WriteLine("CarID: {0}, Make: {1}, Color: {2}, PetName: {3}", c.CarID, c.Make, c.Color, c.PetName); } }
protected void btnFillGrid_Click(object sender, EventArgs e) { Trace.Write("AAAAAAAAAAAAA", "Button Clicked"); InventoryDAL dal = new InventoryDAL(); dal.OpenConnection(@"Data Source=(local)\SQLEXPRESS;Initial Catalog=AutoLot;Integrated Security=True"); carsGridView.DataSource = dal.GetAllInventoryAsList(); carsGridView.DataBind(); dal.CloseConnection(); }
protected void btnFillData_Click(object sender, EventArgs e) { Trace.Write("CodeFileTraceInfo!", "Filling the grid!"); InventoryDAL dal = new InventoryDAL(); dal.OpenConnection(@"Data Source=(local)\SQLEXPRESS;" + "Initial Catalog=AutoLot;Integrated Security=True"); carsGridView.DataSource = dal.GetAllInventoryAsList(); carsGridView.DataBind(); dal.CloseConnection(); }