From c82300da813947a19de8b3945fd23f6e54e83340 Mon Sep 17 00:00:00 2001 From: Kaan Date: Thu, 5 Jun 2025 03:43:09 +0200 Subject: [PATCH] Added classes for Company, Customer, and Vehicle. Also added test for Vehicle class --- Models/Company.cs | 17 +++++++++++++++++ Models/Customer.cs | 11 +++++++++++ Models/Vehicle.cs | 13 +++++++++++++ Program.cs | 26 ++++++++++++++++++++++++-- 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 Models/Company.cs create mode 100644 Models/Customer.cs create mode 100644 Models/Vehicle.cs diff --git a/Models/Company.cs b/Models/Company.cs new file mode 100644 index 0000000..97a3cdc --- /dev/null +++ b/Models/Company.cs @@ -0,0 +1,17 @@ +using System; + +namespace Invoice_App.Models; + +public class Company +{ + public string CompanyName { get; set; } + public string? LogoPath { get; set; } + public string Address { get; set; } + public string ZipCode { get; set; } + public string City { get; set; } + public string CVR { get; set; } + public string PhoneNumber { get; set; } + public string? AccountRegistration { get; set; } + public string? AccountNumber { get; set; } + +} \ No newline at end of file diff --git a/Models/Customer.cs b/Models/Customer.cs new file mode 100644 index 0000000..4397e77 --- /dev/null +++ b/Models/Customer.cs @@ -0,0 +1,11 @@ +namespace Invoice_App.Models; + +public class Customer +{ + public string Name { get; set; } + public string Address { get; set; } + public string? ZipCode { get; set; } + public string? City { get; set; } + public string? PhoneNumber { get; set; } + public string? Email { get; set; } +} \ No newline at end of file diff --git a/Models/Vehicle.cs b/Models/Vehicle.cs new file mode 100644 index 0000000..dcbf3da --- /dev/null +++ b/Models/Vehicle.cs @@ -0,0 +1,13 @@ +using System; + +namespace Invoice_App.Models; + +public class Vehicle +{ + public string? Make { get; set; } + public string? Model { get; set; } + public DateTime? RegistrationDate { get; set; } + public string? VinNumber { get; set; } + public decimal? Kilometers { get; set; } + public string? Comments { get; set; } +} diff --git a/Program.cs b/Program.cs index 66adbdb..b4d57a6 100644 --- a/Program.cs +++ b/Program.cs @@ -1,5 +1,6 @@ using Avalonia; using System; +using Invoice_App.Models; namespace Invoice_App; @@ -9,8 +10,28 @@ class Program // SynchronizationContext-reliant code before AppMain is called: things aren't initialized // yet and stuff might break. [STAThread] - public static void Main(string[] args) => BuildAvaloniaApp() - .StartWithClassicDesktopLifetime(args); + public static void Main(string[] args) + { + + TestVehicleClass(); + + BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + } + + + private static void TestVehicleClass() + { + var testCar = new Vehicle(); + testCar.Make = "BMW"; + testCar.Model = "320i"; + testCar.VinNumber = "ABC123"; + testCar.Kilometers = 50000; + testCar.RegistrationDate = DateTime.Now; + testCar.Comments = "Good condition"; + + // No console output for now - just creating the object to test compilation + } // Avalonia configuration, don't remove; also used by visual designer. public static AppBuilder BuildAvaloniaApp() @@ -18,4 +39,5 @@ class Program .UsePlatformDetect() .WithInterFont() .LogToTrace(); + }