46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using ComputerShopDataModels.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Newtonsoft.Json;
|
|
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();
|
|
public Dictionary<int, (IOrderModel, int)> AssemblyOrders
|
|
{
|
|
get;
|
|
set;
|
|
} = new();
|
|
public int ClientId { get; set; }
|
|
|
|
[DisplayName("ФИО клиента")]
|
|
public string ClientFIO { get; set; } = string.Empty;
|
|
|
|
public AssemblyViewModel()
|
|
{
|
|
|
|
}
|
|
|
|
[JsonConstructor]
|
|
public AssemblyViewModel(Dictionary<int, (IComponentModel, int)> AssemblyComponents)
|
|
{
|
|
this.AssemblyComponents = AssemblyComponents;
|
|
}
|
|
}
|
|
}
|