This commit is contained in:
Frozd
2025-11-28 09:52:24 +01:00
parent 7d71783102
commit c7076476f6
11 changed files with 103 additions and 108 deletions

View File

@@ -17,8 +17,8 @@ namespace CarManagerV2
public MainForm()
{
InitializeComponent();
SafeManager.initializeFile("cars.csv");
List<Car> _cars = SafeManager.readCars("cars.csv");
SafeManager.InitializeFile("cars.csv");
List<Car> _cars = SafeManager.ReadCars("cars.csv");
refreshCars(_cars);
}
@@ -97,7 +97,7 @@ namespace CarManagerV2
// refresh cars
Application.DoEvents();
Console.WriteLine("Refreshing cars...");
List<Car> __cars = SafeManager.readCars("cars.csv");
List<Car> __cars = SafeManager.ReadCars("cars.csv");
refreshCars(__cars);
};
detailsForm.ShowDialog();
@@ -106,30 +106,16 @@ namespace CarManagerV2
}
}
private void CarDetailsForm_Load(object sender, EventArgs e)
{
}
private void MainForm_Load(object sender, EventArgs e)
{
}
private void tableLayoutPanel1_Paint(object sender, PaintEventArgs e)
{
}
private void btnNewCar_Click(object sender, EventArgs e)
{
Car foocar = StateManager.createCar("New", "Car", 2020, "White", 0, 20000);
Car foocar = StateManager.CreateCar("New", "Car", 2020, "White", 0, 20000);
CarDetailsForm detailsForm = new CarDetailsForm(foocar);
detailsForm.FormClosed += (s2, e2) =>
{
// refresh cars
Console.WriteLine("Refreshing cars...");
cars = SafeManager.readCars("cars.csv");
cars = SafeManager.ReadCars("cars.csv");
refreshCars(cars);
};
detailsForm.ShowDialog();