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); } }
private static void ListInventoryViaList(InventoryDal inventory) { var record = inventory.GetAllInventoryAsList(); Console.WriteLine("CarId:\tMake:\tColor:\tPetName:"); foreach (var c in record) { Console.WriteLine($"{c.CarId}\t{c.Make}\t{c.Color}\t{c.PetName}"); } }
protected void fillGridButton_Click(object sender, EventArgs e) { InventoryDal dal = null; try { dal = new InventoryDal(); dal.OpenConnection(AutoLotConnectionString); autoLotGridView.DataSource = dal.GetAllInventoryAsList(); autoLotGridView.DataBind(); Trace.Write("CodeFileTraceInfo!", "Filling the grid!"); // Протоколируем } finally { if (dal != null) { dal.CloseConnection(); } } }