Assembly orders 2
This commit is contained in:
parent
1a849e4fbd
commit
49b8f15517
@ -18,5 +18,10 @@ namespace ComputerShopContracts.BindingModels
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
public Dictionary<int, (IOrderModel, int)> AssemblyOrders
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,11 @@ namespace ComputerShopContracts.ViewModels
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
public Dictionary<int, (IOrderModel, int)> AssemblyOrders
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
public int ClientId { get; set; }
|
||||
|
||||
[DisplayName("ФИО клиента")]
|
||||
|
@ -39,7 +39,7 @@ namespace ComputerShopDatabaseImplement.Models
|
||||
|
||||
private Dictionary<int, (IOrderModel, int)>? _assemblyOrders = null;
|
||||
[NotMapped]
|
||||
public Dictionary<int, (IOrderModel, int)> AssemblyPrders
|
||||
public Dictionary<int, (IOrderModel, int)> AssemblyOrders
|
||||
{
|
||||
get
|
||||
{
|
||||
@ -70,6 +70,12 @@ namespace ComputerShopDatabaseImplement.Models
|
||||
{
|
||||
Component = context.Components.First(y => y.Id == x.Key),
|
||||
Count = x.Value.Item2
|
||||
}).ToList(),
|
||||
Orders = model.AssemblyOrders.Select(x => new
|
||||
AssemblyOrder
|
||||
{
|
||||
Order = context.Orders.First(y => y.Id == x.Key),
|
||||
Count = x.Value.Item2
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
@ -84,6 +90,7 @@ namespace ComputerShopDatabaseImplement.Models
|
||||
AssemblyName = AssemblyName,
|
||||
Price = Price,
|
||||
AssemblyComponents = AssemblyComponents,
|
||||
AssemblyOrders = AssemblyOrders,
|
||||
ClientId = ClientId
|
||||
};
|
||||
public void UpdateComponents(ComputerShopDatabase context, AssemblyBindingModel model)
|
||||
|
Loading…
Reference in New Issue
Block a user