ПИбд-24 Ивлеев Д.А. Лабораторная работа 1 #1
@ -6,15 +6,17 @@ public class Order
|
||||
public int ClientId { get; private set; }
|
||||
public bool Completed { get; private set; }
|
||||
public DateTime Date { get; private set; }
|
||||
public IEnumerable<OrderProduct> OrderProducts { get; private set; } = [];
|
||||
|
||||
public static Order CreateEntity(int id, int clientid, bool completed)
|
||||
public static Order CreateOperation(int id, int clientid, bool completed, IEnumerable<OrderProduct> orderProducts)
|
||||
{
|
||||
return new Order
|
||||
{
|
||||
Id = id,
|
||||
ClientId = clientid,
|
||||
Completed = completed,
|
||||
Date = DateTime.Now
|
||||
Date = DateTime.Now,
|
||||
OrderProducts = orderProducts
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -8,15 +8,17 @@ public class Product
|
||||
public ConfectionaryType ConfectionaryType { get; private set; }
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
public double Price { get; private set; }
|
||||
|
||||
public static Product CreateEntity(int id, ConfectionaryType сonfectionaryType, string name, double price)
|
||||
public IEnumerable<ProductComponent> ProductComponents { get; private set; } = [];
|
||||
|
||||
public static Product CreateEntity(int id, ConfectionaryType сonfectionaryType, string name, double price, IEnumerable<ProductComponent> productComponents)
|
||||
{
|
||||
return new Product
|
||||
{
|
||||
Id = id,
|
||||
ConfectionaryType = сonfectionaryType,
|
||||
Name = name ?? string.Empty,
|
||||
Price = price
|
||||
Price = price,
|
||||
ProductComponents = productComponents
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,17 @@
|
||||
namespace ProjectConfectionaryFactory.Entities;
|
||||
|
||||
public class ComponentProduct
|
||||
public class ProductComponent
|
||||
{
|
||||
public int ComponentId { get; private set; }
|
||||
public int ProductId { get; private set; }
|
||||
public int ComponentId { get; private set; }
|
||||
public double Weight { get; private set; }
|
||||
|
||||
public static ComponentProduct CreateEntity(int componentid, int productid, double weight)
|
||||
public static ProductComponent CreateEntity(int productid, int componentid, double weight)
|
||||
{
|
||||
return new ComponentProduct
|
||||
return new ProductComponent
|
||||
{
|
||||
ComponentId = componentid,
|
||||
ProductId = productid,
|
||||
ComponentId = componentid,
|
||||
Weight = weight
|
||||
};
|
||||
}
|
@ -9,7 +9,7 @@ public class Supply
|
||||
public bool Completed { get; private set; }
|
||||
public DateTime Date { get; private set; }
|
||||
|
||||
public static Supply CreateEntity(int id, int supplierid, int componentid, double weight, bool completed)
|
||||
public static Supply CreateOperation(int id, int supplierid, int componentid, double weight, bool completed)
|
||||
{
|
||||
return new Supply
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user