From 2587d43871c52022a6abce28f961d2cf346a9640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=A4=D0=B5=D0=B4=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Sat, 27 Apr 2024 13:01:57 +0400 Subject: [PATCH] Contracts 0.1 --- ElectronicsShop/ElectronicsShop.sln | 6 +++ .../CategoryProductBindingModel.cs | 16 ++++++++ .../BindingModels/ClientBindingModel.cs | 32 +++++++++++++++ .../BindingModels/OrderBindingModel.cs | 28 +++++++++++++ .../BindingModels/ProductBindingModel.cs | 24 ++++++++++++ .../BindingModels/RoleBindingModel.cs | 16 ++++++++ .../ShopAssistentBindingModel.cs | 32 +++++++++++++++ .../ICategoryProductLogic.cs | 20 ++++++++++ .../BusinessLogicContracts/IClientLogic.cs | 20 ++++++++++ .../BusinessLogicContracts/IOrderLogic.cs | 21 ++++++++++ .../BusinessLogicContracts/IProductLogic.cs | 21 ++++++++++ .../BusinessLogicContracts/IRoleLogic.cs | 20 ++++++++++ .../ShopAssistentLogic.cs | 20 ++++++++++ .../ElectronicsShopContracts.csproj | 13 +++++++ .../CategoryProductSearchModel.cs | 15 +++++++ .../SearchModels/ClientSearchModel.cs | 14 +++++++ .../SearchModels/OrderSearchModel.cs | 16 ++++++++ .../SearchModels/ProductSearchModel.cs | 14 +++++++ .../SearchModels/RoleSearchModel.cs | 15 +++++++ .../SearchModels/ShopAssistentSearchModel.cs | 14 +++++++ .../ViewModels/CategoryProductViewModel.cs | 18 +++++++++ .../ViewModels/ClientViewModel.cs | 39 +++++++++++++++++++ .../ViewModels/OrderViewModel.cs | 33 ++++++++++++++++ .../ViewModels/ProductViewModel.cs | 27 +++++++++++++ .../ViewModels/RoleViewModel.cs | 21 ++++++++++ .../ViewModels/ShopAssistentViewModel.cs | 38 ++++++++++++++++++ 26 files changed, 553 insertions(+) create mode 100644 ElectronicsShop/ElectronicsShopContracts/BindingModels/CategoryProductBindingModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BindingModels/ClientBindingModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BindingModels/OrderBindingModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BindingModels/ProductBindingModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BindingModels/RoleBindingModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BindingModels/ShopAssistentBindingModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/ICategoryProductLogic.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IClientLogic.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IOrderLogic.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IProductLogic.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IRoleLogic.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/ShopAssistentLogic.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/ElectronicsShopContracts.csproj create mode 100644 ElectronicsShop/ElectronicsShopContracts/SearchModels/CategoryProductSearchModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/SearchModels/ClientSearchModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/SearchModels/OrderSearchModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/SearchModels/ProductSearchModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/SearchModels/RoleSearchModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/SearchModels/ShopAssistentSearchModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/ViewModels/CategoryProductViewModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/ViewModels/ClientViewModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/ViewModels/OrderViewModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/ViewModels/ProductViewModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/ViewModels/RoleViewModel.cs create mode 100644 ElectronicsShop/ElectronicsShopContracts/ViewModels/ShopAssistentViewModel.cs diff --git a/ElectronicsShop/ElectronicsShop.sln b/ElectronicsShop/ElectronicsShop.sln index 4ee8438..fbdc137 100644 --- a/ElectronicsShop/ElectronicsShop.sln +++ b/ElectronicsShop/ElectronicsShop.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.9.34728.123 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronicsShopDataModels", "ElectronicsShopDataModels\ElectronicsShopDataModels.csproj", "{380E3833-D9AE-46C7-8881-9B15B8559411}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronicsShopContracts", "ElectronicsShopContracts\ElectronicsShopContracts.csproj", "{69411E41-F304-4D1B-8F15-48DD08585C7A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {380E3833-D9AE-46C7-8881-9B15B8559411}.Debug|Any CPU.Build.0 = Debug|Any CPU {380E3833-D9AE-46C7-8881-9B15B8559411}.Release|Any CPU.ActiveCfg = Release|Any CPU {380E3833-D9AE-46C7-8881-9B15B8559411}.Release|Any CPU.Build.0 = Release|Any CPU + {69411E41-F304-4D1B-8F15-48DD08585C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69411E41-F304-4D1B-8F15-48DD08585C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69411E41-F304-4D1B-8F15-48DD08585C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69411E41-F304-4D1B-8F15-48DD08585C7A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/CategoryProductBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/CategoryProductBindingModel.cs new file mode 100644 index 0000000..eecc797 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/CategoryProductBindingModel.cs @@ -0,0 +1,16 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BindingModels +{ + public class CategoryProductBindingModel : ICategoryProductModel + { + public int ID { get; set; } + + public string Name { get; set; } = string.Empty; + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/ClientBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..ef63388 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,32 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BindingModels +{ + public class ClientBindingModel : IClientModel + { + //ID пользователя + public int UserID { get; set; } + //ID клиента + public int ID { get; set; } + + + public string FirstName { get; set; } = string.Empty; + + public string LastName { get; set; } = string.Empty; + + public string Login { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + + public int RoleID { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/OrderBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..f6007ab --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,28 @@ +using ElectronicsShopDataModels.Enums; +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BindingModels +{ + public class OrderBindingModel : IOrderModel + { + public int ID { get; set; } + + public double Sum { get; set; } + + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + + public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно; + + public DateTime DateCreate { get; set; } = DateTime.Now; + + public DateTime? DateImplemet { get; set; } + + public Dictionary ProductList { get; set; } = new(); + + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/ProductBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ProductBindingModel.cs new file mode 100644 index 0000000..eb513f6 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ProductBindingModel.cs @@ -0,0 +1,24 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BindingModels +{ + public class ProductBindingModel : IProductModel + { + //ID категории продукта (товара) + public int CategoryID { get; set; } + //ID продукта (товара) + public int ID { get; set; } + + + public string ProductName { get; set; } = string.Empty; + + public double Price { get; set; } + + public int Count { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/RoleBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/RoleBindingModel.cs new file mode 100644 index 0000000..3d2a806 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/RoleBindingModel.cs @@ -0,0 +1,16 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BindingModels +{ + public class RoleBindingModel : IRoleModel + { + public int ID { get; set; } + + public string Name { get; set; } = string.Empty; + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/ShopAssistentBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ShopAssistentBindingModel.cs new file mode 100644 index 0000000..e60a396 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/ShopAssistentBindingModel.cs @@ -0,0 +1,32 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BindingModels +{ + public class ShopAssistentBindingModel : IShopAssistentModel + { + //ID пользователя + public int UserID { get; set; } + //ID роли (сотрудник) + public int RoleID { get; set; } + //ID сотрудника + public int ID { get; set; } + + + public string FirstName { get; set; } = string.Empty; + + public string LastName { get; set; } = string.Empty; + + public string Login { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/ICategoryProductLogic.cs b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/ICategoryProductLogic.cs new file mode 100644 index 0000000..e788e9f --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/ICategoryProductLogic.cs @@ -0,0 +1,20 @@ +using ElectronicsShopContracts.BindingModels; +using ElectronicsShopContracts.SearchModels; +using ElectronicsShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BusinessLogicContracts +{ + public interface ICategoryProductLogic + { + List? ReadList(CategoryProductSearchModel? model); + + bool Create(CategoryProductBindingModel model); + bool Update(CategoryProductBindingModel model); + bool Delete(CategoryProductBindingModel model); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IClientLogic.cs b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IClientLogic.cs new file mode 100644 index 0000000..6ce2a92 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IClientLogic.cs @@ -0,0 +1,20 @@ +using ElectronicsShopContracts.BindingModels; +using ElectronicsShopContracts.SearchModels; +using ElectronicsShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BusinessLogicContracts +{ + public interface IClientLogic + { + List? ReadList(ClientSearchModel? model); + + bool ClientAdd(ClientBindingModel model); + bool ClientUpdate(ClientBindingModel model); + bool ClientDelete(ClientBindingModel model); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IOrderLogic.cs b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IOrderLogic.cs new file mode 100644 index 0000000..26f1b3c --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IOrderLogic.cs @@ -0,0 +1,21 @@ +using ElectronicsShopContracts.BindingModels; +using ElectronicsShopContracts.SearchModels; +using ElectronicsShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BusinessLogicContracts +{ + public interface IOrderLogic + { + List? ReadList(OrderSearchModel? model); + + bool CreateOrder(OrderBindingModel model); + bool TakeOrderInWork(OrderBindingModel model); + bool FinishOrder(OrderBindingModel model); + bool DeliveryOrder(OrderBindingModel model); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IProductLogic.cs b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IProductLogic.cs new file mode 100644 index 0000000..0289e55 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IProductLogic.cs @@ -0,0 +1,21 @@ +using ElectronicsShopContracts.BindingModels; +using ElectronicsShopContracts.SearchModels; +using ElectronicsShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BusinessLogicContracts +{ + public interface IProductLogic + { + List? ReadList(ProductSearchModel? model); + ProductViewModel? ReadProduct(ProductSearchModel? model); + + bool Create(ProductBindingModel model); + bool Update(ProductBindingModel model); + bool Delete(ProductBindingModel model); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IRoleLogic.cs b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IRoleLogic.cs new file mode 100644 index 0000000..6141581 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/IRoleLogic.cs @@ -0,0 +1,20 @@ +using ElectronicsShopContracts.BindingModels; +using ElectronicsShopContracts.SearchModels; +using ElectronicsShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BusinessLogicContracts +{ + public interface IRoleLogic + { + List? ReadList(RoleSearchModel? model); + + bool Create(RoleBindingModel model); + bool Update(RoleBindingModel model); + bool Delete(RoleBindingModel model); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/ShopAssistentLogic.cs b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/ShopAssistentLogic.cs new file mode 100644 index 0000000..0e082fc --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/BusinessLogicContracts/ShopAssistentLogic.cs @@ -0,0 +1,20 @@ +using ElectronicsShopContracts.BindingModels; +using ElectronicsShopContracts.SearchModels; +using ElectronicsShopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.BusinessLogicContracts +{ + public interface ShopAssistentLogic + { + List? ReadList(ShopAssistentSearchModel? model); + + bool ClientCreate(ShopAssistentBindingModel model); + bool ClientUpdate(ShopAssistentBindingModel model); + bool ClientDelete(ShopAssistentBindingModel model); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/ElectronicsShopContracts.csproj b/ElectronicsShop/ElectronicsShopContracts/ElectronicsShopContracts.csproj new file mode 100644 index 0000000..5c8a174 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/ElectronicsShopContracts.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/ElectronicsShop/ElectronicsShopContracts/SearchModels/CategoryProductSearchModel.cs b/ElectronicsShop/ElectronicsShopContracts/SearchModels/CategoryProductSearchModel.cs new file mode 100644 index 0000000..2eddcd6 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/SearchModels/CategoryProductSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.SearchModels +{ + public class CategoryProductSearchModel + { + public int? ID { get; set; } + + public string? Name { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/SearchModels/ClientSearchModel.cs b/ElectronicsShop/ElectronicsShopContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..c64d20c --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.SearchModels +{ + public class ClientSearchModel + { + public int? ID { get; set; } + public string? Login { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/SearchModels/OrderSearchModel.cs b/ElectronicsShop/ElectronicsShopContracts/SearchModels/OrderSearchModel.cs new file mode 100644 index 0000000..72c8848 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/SearchModels/OrderSearchModel.cs @@ -0,0 +1,16 @@ +using ElectronicsShopDataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.SearchModels +{ + public class OrderSearchModel + { + public int? ID { get; set; } + public DateTime? DateFrom { get; set; } + public DateTime? DateTo { get; set;} + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/SearchModels/ProductSearchModel.cs b/ElectronicsShop/ElectronicsShopContracts/SearchModels/ProductSearchModel.cs new file mode 100644 index 0000000..7b21e54 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/SearchModels/ProductSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.SearchModels +{ + public class ProductSearchModel + { + public int? ID { get; set; } + public string? ProductName { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/SearchModels/RoleSearchModel.cs b/ElectronicsShop/ElectronicsShopContracts/SearchModels/RoleSearchModel.cs new file mode 100644 index 0000000..4efaa8b --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/SearchModels/RoleSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.SearchModels +{ + public class RoleSearchModel + { + public int? ID { get; set; } + + public string? Name { get; set; } = string.Empty; + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/SearchModels/ShopAssistentSearchModel.cs b/ElectronicsShop/ElectronicsShopContracts/SearchModels/ShopAssistentSearchModel.cs new file mode 100644 index 0000000..e5096c9 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/SearchModels/ShopAssistentSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.SearchModels +{ + public class ShopAssistentSearchModel + { + public int? ID { get; set; } + public string? Login { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/CategoryProductViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/CategoryProductViewModel.cs new file mode 100644 index 0000000..35cc4af --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/CategoryProductViewModel.cs @@ -0,0 +1,18 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.ViewModels +{ + public class CategoryProductViewModel : ICategoryProductModel + { + public int ID { get; set; } + + [DisplayName("Название категории продукта")] + public string Name { get; set; } = string.Empty; + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/ClientViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..e88b4dc --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,39 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.ViewModels +{ + public class ClientViewModel : IClientModel + { + + //ID пользователя + public int UserID { get; set; } + //ID клиента + public int ID { get; set; } + + [DisplayName("Имя")] + public string FirstName { get; set; } = string.Empty; + + [DisplayName("Фамилия")] + public string LastName { get; set; } = string.Empty; + + [DisplayName("Логин")] + public string Login { get; set; } = string.Empty; + + [DisplayName("Почта")] + public string Email { get; set; } = string.Empty; + + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + + [DisplayName("Номер телефона")] + public string PhoneNumber { get; set; } = string.Empty; + + public int RoleID { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/OrderViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..d063fca --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,33 @@ +using ElectronicsShopDataModels.Enums; +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.ViewModels +{ + public class OrderViewModel : IOrderModel + { + public int ID { get; set; } + + [DisplayName("Сумма")] + public double Sum { get; set; } + + [DisplayName("Статус")] + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + + [DisplayName("Стутус оплаты")] + public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно; + + [DisplayName("Дата создания")] + public DateTime DateCreate { get; set; } = DateTime.Now; + + [DisplayName("Дата выполнения")] + public DateTime? DateImplemet { get; set; } + + public Dictionary ProductList { get; set; } = new(); + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/ProductViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ProductViewModel.cs new file mode 100644 index 0000000..45b9583 --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ProductViewModel.cs @@ -0,0 +1,27 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.ViewModels +{ + public class ProductViewModel : IProductModel + { + //ID категории продукта (товара) + public int CategoryID { get; set; } + //ID продукта (товара) + public int ID { get; set; } + + [DisplayName("Название товара")] + public string ProductName { get; set; } = string.Empty; + + [DisplayName("Цена")] + public double Price { get; set; } + + [DisplayName("Количество")] + public int Count { get; set; } + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/RoleViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/RoleViewModel.cs new file mode 100644 index 0000000..77dadcf --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/RoleViewModel.cs @@ -0,0 +1,21 @@ +using ElectronicsShopDataModels; +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.ViewModels +{ + public class RoleViewModel : IRoleModel + { + public int ID { get; set; } + + [DisplayName("Название роли")] + public string Name { get; set; } = string.Empty; + + + } +} diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/ShopAssistentViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ShopAssistentViewModel.cs new file mode 100644 index 0000000..d18757a --- /dev/null +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/ShopAssistentViewModel.cs @@ -0,0 +1,38 @@ +using ElectronicsShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectronicsShopContracts.ViewModels +{ + public class ShopAssistentViewModel : IShopAssistentModel + { + //ID пользователя + public int UserID { get; set; } + //ID роли (сотрудник) + public int RoleID { get; set; } + //ID сотрудника + public int ID { get; set; } + + [DisplayName("Имя")] + public string FirstName { get; set; } = string.Empty; + + [DisplayName("Фамилия")] + public string LastName { get; set; } = string.Empty; + + [DisplayName("Логин")] + public string Login { get; set; } = string.Empty; + + [DisplayName("Почта")] + public string Email { get; set; } = string.Empty; + + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + + [DisplayName("Номер телефона")] + public string PhoneNumber { get; set; } = string.Empty; + } +}