Создание перечисления, сущностей-операций и сущностей-связей многих ко многим
This commit is contained in:
parent
a52f8193a0
commit
367073709c
@ -0,0 +1,18 @@
|
|||||||
|
namespace ProjectConfectionaryFactory.Entities;
|
||||||
|
|
||||||
|
public class ComponentProduct
|
||||||
|
{
|
||||||
|
public int ComponentId { get; private set; }
|
||||||
|
public int ProductId { get; private set; }
|
||||||
|
public double Weight { get; private set; }
|
||||||
|
|
||||||
|
public static ComponentProduct CreateEntity(int componentid, int productid, double weight)
|
||||||
|
{
|
||||||
|
return new ComponentProduct
|
||||||
|
{
|
||||||
|
ComponentId = componentid,
|
||||||
|
ProductId = productid,
|
||||||
|
Weight = weight
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
namespace ProjectConfectionaryFactory.Entities.Enums;
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum ConfectionaryType
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Cake = 1,
|
||||||
|
Roll = 2,
|
||||||
|
Cupcake = 4,
|
||||||
|
Cookie = 8
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
namespace ProjectConfectionaryFactory.Entities;
|
||||||
|
|
||||||
|
public class Order
|
||||||
|
{
|
||||||
|
public int Id { get; private set; }
|
||||||
|
public int ClientId { get; private set; }
|
||||||
|
public bool Completed { get; private set; }
|
||||||
|
public DateTime Date { get; private set; }
|
||||||
|
|
||||||
|
public static Order CreateEntity(int id, int clientid, bool completed)
|
||||||
|
{
|
||||||
|
return new Order
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
ClientId = clientid,
|
||||||
|
Completed = completed,
|
||||||
|
Date = DateTime.Now
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
namespace ProjectConfectionaryFactory.Entities;
|
||||||
|
|
||||||
|
public class OrderProduct
|
||||||
|
{
|
||||||
|
public int OrderId { get; private set; }
|
||||||
|
public int ProductId { get; private set; }
|
||||||
|
public int Count { get; private set; }
|
||||||
|
|
||||||
|
public static OrderProduct CreateEntity(int orderid, int productid, int count)
|
||||||
|
{
|
||||||
|
return new OrderProduct
|
||||||
|
{
|
||||||
|
OrderId = orderid,
|
||||||
|
ProductId = productid,
|
||||||
|
Count = count
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
namespace ProjectConfectionaryFactory.Entities;
|
||||||
|
|
||||||
|
public class Supply
|
||||||
|
{
|
||||||
|
public int Id { get; private set; }
|
||||||
|
public int SupplierId { get; private set; }
|
||||||
|
public int ComponentId { get; private set; }
|
||||||
|
public double Weight { get; private set; }
|
||||||
|
public DateTime Date { get; private set; }
|
||||||
|
|
||||||
|
public static Supply CreateEntity(int id, int supplierid, int componentid, double weight)
|
||||||
|
{
|
||||||
|
return new Supply
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
SupplierId = supplierid,
|
||||||
|
ComponentId = componentid,
|
||||||
|
Weight = weight,
|
||||||
|
Date = DateTime.Now
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user