84 lines
1.7 KiB
C#
84 lines
1.7 KiB
C#
using System.Runtime.CompilerServices;
|
|
using C968Project.Views;
|
|
|
|
namespace C968Project;
|
|
|
|
static class Program
|
|
{
|
|
|
|
public static Inventory Inventory = new();
|
|
public static int PartIdCounter = 1;
|
|
public static int ProductIdCounter = 1;
|
|
|
|
private static Part _testInhousePart = new Inhouse()
|
|
{
|
|
Name = "Inhouse part",
|
|
Min = 0,
|
|
Max = 100,
|
|
Price = 10,
|
|
InStock = 50,
|
|
PartID = 0,
|
|
MachineID = 2
|
|
};
|
|
private static Part _testOutsourcedPart = new Outsourced()
|
|
{
|
|
Name = "Outsourced part",
|
|
Min = 10,
|
|
Max = 100,
|
|
Price = 5,
|
|
InStock = 21,
|
|
PartID = 1,
|
|
CompanyName = "Chem Inc."
|
|
};
|
|
|
|
private static Product _testProduct = new Product()
|
|
{
|
|
Name = "One Product",
|
|
InStock = 500,
|
|
Max = 4000,
|
|
Min = 2,
|
|
Price = 5.45f,
|
|
ProductId = 0,
|
|
};
|
|
|
|
private static Product _testProduct2 = new Product()
|
|
{
|
|
Name = "Two Product",
|
|
InStock = 1,
|
|
Max = 1,
|
|
Min = 1,
|
|
Price = 1.40f,
|
|
ProductId = 1,
|
|
};
|
|
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
Inventory.AddPart(_testOutsourcedPart);
|
|
Inventory.AddPart(_testInhousePart);
|
|
Inventory.AddProduct(_testProduct);
|
|
Inventory.AddProduct(_testProduct2);
|
|
Inventory.Products[0].AddAssociatedPart(Inventory.Parts[0]);
|
|
|
|
ApplicationConfiguration.Initialize();
|
|
Application.Run(new MainScreen());
|
|
}
|
|
|
|
public static int CreateNewProductId()
|
|
{
|
|
ProductIdCounter++;
|
|
return ProductIdCounter;
|
|
}
|
|
|
|
public static int CreateNewPartId()
|
|
{
|
|
PartIdCounter++;
|
|
return PartIdCounter;
|
|
}
|
|
}
|
|
|
|
public enum ScreenOption
|
|
{
|
|
ADD,
|
|
MODIFY
|
|
} |