From 873df1007e9248ea3ca74aa70c8f2c0d67be3189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 5 Feb 2023 15:14:18 +0400 Subject: [PATCH] fix --- .../BindingModels/ShopBindingModel.cs | 22 +++++++++++----- .../ViewModels/ShopViewModel.cs | 26 ++++++++++++++----- ConfectioneryDataModels/IShopModel.cs | 12 ++++----- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/ConfectioneryContracts/BindingModels/ShopBindingModel.cs b/ConfectioneryContracts/BindingModels/ShopBindingModel.cs index 764dc63..991d04b 100644 --- a/ConfectioneryContracts/BindingModels/ShopBindingModel.cs +++ b/ConfectioneryContracts/BindingModels/ShopBindingModel.cs @@ -1,12 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using ConfectioneryDataModels; +using ConfectioneryDataModels.Models; namespace ConfectioneryContracts.BindingModels { - internal interface ShopBindingModel + public class ShopBindingModel : IShopModel { + public string Name { get; set; } = string.Empty; + + public string Address { get; set; } = string.Empty; + + public DateTime DateOpening { get; set; } = DateTime.Now; + + public Dictionary Pastries + { + get; + set; + } = new(); + + public int Id { get; set; } } } diff --git a/ConfectioneryContracts/ViewModels/ShopViewModel.cs b/ConfectioneryContracts/ViewModels/ShopViewModel.cs index dbfc7c6..dd01f43 100644 --- a/ConfectioneryContracts/ViewModels/ShopViewModel.cs +++ b/ConfectioneryContracts/ViewModels/ShopViewModel.cs @@ -1,12 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using ConfectioneryDataModels; +using ConfectioneryDataModels.Models; +using System.ComponentModel; namespace ConfectioneryContracts.ViewModels { - internal class ShopViewModel + public class ShopViewModel : IShopModel { + [DisplayName("Название магазина")] + public string Name { get; set; } = string.Empty; + + [DisplayName("Адрес магазина")] + public string Address { get; set; } = string.Empty; + + [DisplayName("Время открытия")] + public DateTime DateOpening { get; set; } = DateTime.Now; + + public Dictionary Pastries + { + get; + set; + } = new(); + + public int Id { get; set; } } } diff --git a/ConfectioneryDataModels/IShopModel.cs b/ConfectioneryDataModels/IShopModel.cs index 7315e2f..1f1e07f 100644 --- a/ConfectioneryDataModels/IShopModel.cs +++ b/ConfectioneryDataModels/IShopModel.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using ConfectioneryDataModels.Models; namespace ConfectioneryDataModels { - internal interface IShopModel + public interface IShopModel : IId { + string Name { get; } + string Address { get; } + DateTime DateOpening { get; } + Dictionary Pastries { get; } } }