2024-04-23 21:55:59 +04:00
|
|
|
|
using ComputerShopDataModels.Models;
|
2024-05-26 19:33:48 +04:00
|
|
|
|
using Newtonsoft.Json;
|
2024-04-23 21:55:59 +04:00
|
|
|
|
using System;
|
2024-04-17 21:45:53 +04:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ComputerShopContracts.ViewModels
|
|
|
|
|
{
|
2024-04-23 22:25:40 +04:00
|
|
|
|
public class ShipmentViewModel : IShipmentModel
|
2024-04-17 21:45:53 +04:00
|
|
|
|
{
|
|
|
|
|
[DisplayName("Номер")]
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
public int UserId { get; set; }
|
|
|
|
|
|
2024-04-23 21:55:59 +04:00
|
|
|
|
public Dictionary<int, IOrderModel> ShipmentOrders { get; set; } = new();
|
|
|
|
|
|
2024-04-30 22:44:30 +04:00
|
|
|
|
|
2024-04-17 21:45:53 +04:00
|
|
|
|
[DisplayName("Поставщик")]
|
|
|
|
|
public string ProviderName { get; set; } = string.Empty;
|
|
|
|
|
|
2024-04-30 22:44:30 +04:00
|
|
|
|
|
2024-04-17 21:45:53 +04:00
|
|
|
|
[DisplayName("Дата поставки")]
|
|
|
|
|
public DateTime DateShipment { get; set; } = DateTime.Now;
|
|
|
|
|
|
2024-05-26 19:33:48 +04:00
|
|
|
|
|
|
|
|
|
public ShipmentViewModel() { }
|
|
|
|
|
|
|
|
|
|
[JsonConstructor]
|
|
|
|
|
public ShipmentViewModel(Dictionary<int, OrderViewModel> shipmentOrders)
|
|
|
|
|
{
|
|
|
|
|
this.ShipmentOrders = shipmentOrders.ToDictionary(x => x.Key, x => x.Value as IOrderModel);
|
|
|
|
|
}
|
2024-04-17 21:45:53 +04:00
|
|
|
|
}
|
|
|
|
|
}
|