From cefaf57a7203d4672bfc0c3efdf0c17c12ee563b Mon Sep 17 00:00:00 2001 From: malimova Date: Thu, 15 Feb 2024 22:55:26 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BB=D0=B0=D1=81=D1=81=D1=8B=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20ViewModels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConfectioneryContracts.csproj | 1 - .../ViewModels/ComponentViewModel.cs | 19 ++++++++++++ .../ViewModels/OrderViewModel.cs | 30 +++++++++++++++++++ .../ViewModels/PastryViewModel.cs | 20 +++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 Confectionery/ConfectioneryContracts/ViewModels/ComponentViewModel.cs create mode 100644 Confectionery/ConfectioneryContracts/ViewModels/OrderViewModel.cs create mode 100644 Confectionery/ConfectioneryContracts/ViewModels/PastryViewModel.cs diff --git a/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj b/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj index 1c181e8..1bf7525 100644 --- a/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj +++ b/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj @@ -13,7 +13,6 @@ - diff --git a/Confectionery/ConfectioneryContracts/ViewModels/ComponentViewModel.cs b/Confectionery/ConfectioneryContracts/ViewModels/ComponentViewModel.cs new file mode 100644 index 0000000..7ef4f36 --- /dev/null +++ b/Confectionery/ConfectioneryContracts/ViewModels/ComponentViewModel.cs @@ -0,0 +1,19 @@ +using ConfectioneryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.ViewModels +{ + public class ComponentViewModel : IComponentModel + { + public int Id { get; set; } + [DisplayName("Название компонента")] + public string ComponentName { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Cost { get; set; } + } +} diff --git a/Confectionery/ConfectioneryContracts/ViewModels/OrderViewModel.cs b/Confectionery/ConfectioneryContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..217f85f --- /dev/null +++ b/Confectionery/ConfectioneryContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,30 @@ +using ConfectioneryDataModels.Enums; +using ConfectioneryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.ViewModels +{ + public class OrderViewModel : IOrderModel + { + [DisplayName("Номер")] + public int Id { get; set; } + public int PastryId { get; set; } + [DisplayName("Изделие")] + public string PastryName { get; set; } = string.Empty; + [DisplayName("Количество")] + public int Count { get; set; } + [DisplayName("Сумма")] + public double Sum { get; set; } + [DisplayName("Статус")] + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + [DisplayName("Дата создания")] + public DateTime DateCreate { get; set; } = DateTime.Now; + [DisplayName("Дата выполнения")] + public DateTime? DateImplement { get; set; } + } +} diff --git a/Confectionery/ConfectioneryContracts/ViewModels/PastryViewModel.cs b/Confectionery/ConfectioneryContracts/ViewModels/PastryViewModel.cs new file mode 100644 index 0000000..15257b0 --- /dev/null +++ b/Confectionery/ConfectioneryContracts/ViewModels/PastryViewModel.cs @@ -0,0 +1,20 @@ +using ConfectioneryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.ViewModels +{ + public class PastryViewModel : IPastryModel + { + public int Id { get; set; } + [DisplayName("Название изделия")] + public string PastryName { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Price { get; set; } + public Dictionary PastryComponents { get; set; } = new(); + } +}