Function in Class
This commit is contained in:
@@ -18,7 +18,6 @@ namespace CarManagerV2
|
||||
public CarDetailsForm(Car car)
|
||||
{
|
||||
InitializeComponent();
|
||||
Console.WriteLine(car.Id);
|
||||
this.car = car;
|
||||
tbxMake.Text = car.Make;
|
||||
tbxModel.Text = car.Model;
|
||||
@@ -48,7 +47,6 @@ namespace CarManagerV2
|
||||
private void nudYear_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
car.Year = (int)nudYear.Value;
|
||||
Console.WriteLine(car.Year);
|
||||
}
|
||||
|
||||
private void tbxColor_TextChanged(object sender, EventArgs e)
|
||||
@@ -69,10 +67,15 @@ namespace CarManagerV2
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
// save car to cars.csv and close form
|
||||
Console.WriteLine("Saving car: " + car.Id);
|
||||
Console.WriteLine("Car year: " + car.Year);
|
||||
//saving car... popuo
|
||||
var msgbox = new PleaseWait();
|
||||
msgbox.Show();
|
||||
Application.DoEvents();
|
||||
StateManager.updateCar(car);
|
||||
Image fooimg = ImageManager.GetImage(car);
|
||||
msgbox.Close();
|
||||
this.Close();
|
||||
|
||||
}
|
||||
|
||||
private void btnDelete_Click(object sender, EventArgs e)
|
||||
@@ -81,6 +84,7 @@ namespace CarManagerV2
|
||||
var result = MessageBox.Show("Are you sure you want to delete this car?", "Delete Car", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
Console.WriteLine("Deleting car: " + car.Id);
|
||||
StateManager.removeCar(car);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user