private static void InsertNewCar(InventoryDAL invDAL) { // First get the user data. int newCarID; string newCarColor, newCarMake, newCarPetName; Console.Write("Enter Car ID: "); newCarID = int.Parse(Console.ReadLine()); Console.Write("Enter Car Color: "); newCarColor = Console.ReadLine(); Console.Write("Enter Car Make: "); newCarMake = Console.ReadLine(); Console.Write("Enter Pet Name: "); newCarPetName = Console.ReadLine(); // Now pass to data access library. // invDAL.InsertAuto(newCarID, newCarColor, newCarMake, newCarPetName); NewCar c = new NewCar { CarID = newCarID, Color = newCarColor, Make = newCarMake, PetName = newCarPetName }; invDAL.InsertAuto(c); }
public void InsertCar(InventoryRecord car) { InventoryDAL d = new InventoryDAL(); d.OpenConnection(ConnString); d.InsertAuto(car.ID, car.Color, car.Make, car.PetName); d.CloseConnection(); }
public void InsertCar(int id, string make, string color, string petname) { InventoryDAL d = new InventoryDAL(); d.OpenConnection(ConnString); d.InsertAuto(id, color, make, petname); d.CloseConnection(); }
protected void btnAddCar_Click(object sender, EventArgs e) { // Update the Inventory table // and call RefreshGrid(). InventoryDAL dal = new InventoryDAL(); dal.OpenConnection(@"Data Source=(local)\SQLEXPRESS;" + "Initial Catalog=AutoLot;Integrated Security=True"); dal.InsertAuto(int.Parse(txtCarID.Text), txtCarColor.Text, txtCarMake.Text, txtCarPetName.Text); dal.CloseConnection(); RefreshGrid(); }
private static void InsertNewCar(InventoryDAL dal) { string newCarMake, newCarColor, newCarPetName; Console.WriteLine("Enter car Make:"); newCarMake = Console.ReadLine(); Console.WriteLine("Enter car Color:"); newCarColor = Console.ReadLine(); Console.WriteLine("Enter car PetName"); newCarPetName = Console.ReadLine(); dal.InsertAuto(newCarColor, newCarMake, newCarPetName); }
private static void InsertNewCar(InventoryDAL invDAL) { //Get user data. int newCarID; string newCarColor, newCarMake, newCarPetName; Console.Write("Enter Car ID: "); newCarID = int.Parse(Console.ReadLine()); Console.Write("Enter Car Color: "); newCarColor = Console.ReadLine(); Console.Write("Enter Car Make: "); newCarMake = Console.ReadLine(); Console.Write("Enter Car Pet Name: "); newCarPetName = Console.ReadLine(); // Insert data into access library invDAL.InsertAuto(newCarID, newCarColor, newCarMake, newCarPetName); }
private void InsertNewCar(InventoryDAL inventory) { Console.WriteLine("Enter Car ID:"); int id = int.Parse( Console.ReadLine() ); Console.WriteLine("Enter Car Color:"); string color = Console.ReadLine(); Console.WriteLine("Enter Car Make:"); string make = Console.ReadLine(); Console.WriteLine("Enter Pet Name:"); string petName = Console.ReadLine(); inventory.InsertAuto(id, color, make, petName); }
static void InsertNewCar(InventoryDAL invDal, NewCar c) { invDal.InsertAuto(c); }