2023-04-05 18:31:49 +04:00
|
|
|
|
using ComputerShopDataModels.Models;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2023-05-17 15:27:57 +04:00
|
|
|
|
using Newtonsoft.Json;
|
2023-04-05 18:31:49 +04:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ComputerShopContracts.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public class AssemblyViewModel : IAssemblyModel
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
[DisplayName("Название изделия")]
|
|
|
|
|
public string AssemblyName { get; set; } = string.Empty;
|
|
|
|
|
[DisplayName("Цена")]
|
|
|
|
|
public double Price { get; set; }
|
|
|
|
|
public Dictionary<int, (IComponentModel, int)> AssemblyComponents
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
} = new();
|
2023-05-18 18:33:33 +04:00
|
|
|
|
public Dictionary<int, (IOrderModel, int)> AssemblyOrders
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
} = new();
|
2023-04-09 11:30:54 +04:00
|
|
|
|
public int ClientId { get; set; }
|
|
|
|
|
|
|
|
|
|
[DisplayName("ФИО клиента")]
|
|
|
|
|
public string ClientFIO { get; set; } = string.Empty;
|
2023-05-17 15:27:57 +04:00
|
|
|
|
|
|
|
|
|
public AssemblyViewModel()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[JsonConstructor]
|
|
|
|
|
public AssemblyViewModel(Dictionary<int, (IComponentModel, int)> AssemblyComponents)
|
|
|
|
|
{
|
|
|
|
|
this.AssemblyComponents = AssemblyComponents;
|
|
|
|
|
}
|
2023-04-05 18:31:49 +04:00
|
|
|
|
}
|
|
|
|
|
}
|