32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using CarCenterDataModels.Models;
|
|
using System.ComponentModel;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace CarCenterContracts.ViewModels
|
|
{
|
|
public class PreSaleWorkModel : IPreSaleWorkModel
|
|
{
|
|
[DisplayName("Тип предпродажной работы")]
|
|
public string PreSaleWorkType { get; set; } = string.Empty;
|
|
|
|
[DisplayName("Стоимость предпродажной работы")]
|
|
public double PreSaleWorkPrice { get; set; }
|
|
|
|
public int ManagerId { get; set; }
|
|
|
|
public int Id { get; set; }
|
|
|
|
public Dictionary<int, ISaleModel> PreSaleWorkSale { get; set; } = new();
|
|
public Dictionary<int, ICarModel> PreSaleWorkCars { get; set; } = new();
|
|
|
|
public PreSaleWorkModel() { }
|
|
|
|
[JsonConstructor]
|
|
public PreSaleWorkModel(Dictionary<int, SaleViewModel> PreSaleWorkSale, Dictionary<int, CarViewModel> PreSaleWorkCars)
|
|
{
|
|
this.PreSaleWorkSale = PreSaleWorkSale.ToDictionary(x => x.Key, x => x.Value as ISaleModel);
|
|
this.PreSaleWorkCars = PreSaleWorkCars.ToDictionary(x => x.Key, x => x.Value as ICarModel);
|
|
}
|
|
}
|
|
}
|