Added classes for Company, Customer, and Vehicle. Also added test for Vehicle class
Some checks failed
Avalonia Code Quality / Lint, Analyze & Build (push) Failing after 55s
Some checks failed
Avalonia Code Quality / Lint, Analyze & Build (push) Failing after 55s
This commit is contained in:
17
Models/Company.cs
Normal file
17
Models/Company.cs
Normal file
@ -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; }
|
||||||
|
|
||||||
|
}
|
||||||
11
Models/Customer.cs
Normal file
11
Models/Customer.cs
Normal file
@ -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; }
|
||||||
|
}
|
||||||
13
Models/Vehicle.cs
Normal file
13
Models/Vehicle.cs
Normal file
@ -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; }
|
||||||
|
}
|
||||||
24
Program.cs
24
Program.cs
@ -1,5 +1,6 @@
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using System;
|
using System;
|
||||||
|
using Invoice_App.Models;
|
||||||
|
|
||||||
namespace Invoice_App;
|
namespace Invoice_App;
|
||||||
|
|
||||||
@ -9,8 +10,28 @@ class Program
|
|||||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||||
// yet and stuff might break.
|
// yet and stuff might break.
|
||||||
[STAThread]
|
[STAThread]
|
||||||
public static void Main(string[] args) => BuildAvaloniaApp()
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
|
||||||
|
TestVehicleClass();
|
||||||
|
|
||||||
|
BuildAvaloniaApp()
|
||||||
.StartWithClassicDesktopLifetime(args);
|
.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.
|
// Avalonia configuration, don't remove; also used by visual designer.
|
||||||
public static AppBuilder BuildAvaloniaApp()
|
public static AppBuilder BuildAvaloniaApp()
|
||||||
@ -18,4 +39,5 @@ class Program
|
|||||||
.UsePlatformDetect()
|
.UsePlatformDetect()
|
||||||
.WithInterFont()
|
.WithInterFont()
|
||||||
.LogToTrace();
|
.LogToTrace();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user