2024-05-27 23:35:42 +04:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using ServiceStationDataModels.Enums;
|
2024-04-27 16:16:58 +04:00
|
|
|
|
using ServiceStationDataModels.Models;
|
|
|
|
|
using System.ComponentModel;
|
2024-04-29 00:50:40 +04:00
|
|
|
|
|
2024-04-27 16:16:58 +04:00
|
|
|
|
|
|
|
|
|
namespace ServiceStationContracts.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public class WorkViewModel : IWorkModel
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
2024-04-27 19:12:43 +04:00
|
|
|
|
[DisplayName("Наименование работы")]
|
2024-04-27 16:16:58 +04:00
|
|
|
|
public string WorkName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
[DisplayName("Статус работы")]
|
|
|
|
|
public WorkStatus Status { get; set; }
|
|
|
|
|
|
|
|
|
|
[DisplayName("Стоимость работы")]
|
|
|
|
|
public double WorkPrice { get; set; }
|
|
|
|
|
|
2024-04-27 19:12:43 +04:00
|
|
|
|
public int GuarantorId { get; set; }
|
2024-04-27 16:16:58 +04:00
|
|
|
|
|
2024-04-29 00:50:40 +04:00
|
|
|
|
public int? TechnicalWorkId { get; set; }
|
|
|
|
|
|
|
|
|
|
public Dictionary<int, ISparePartModel> WorkSpareParts { get; set; } = new();
|
2024-05-27 23:35:42 +04:00
|
|
|
|
|
|
|
|
|
public WorkViewModel() { }
|
|
|
|
|
|
|
|
|
|
[JsonConstructor]
|
|
|
|
|
public WorkViewModel(Dictionary<int, SparePartViewModel> WorkSpareParts)
|
|
|
|
|
{
|
|
|
|
|
this.WorkSpareParts = WorkSpareParts.ToDictionary(x => x.Key, x => x.Value as ISparePartModel);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-27 16:16:58 +04:00
|
|
|
|
}
|