From 9472c2e6916dbf963473cb454c3a23fcb8863126 Mon Sep 17 00:00:00 2001 From: Ismailov_Rovshan Date: Wed, 5 Apr 2023 22:38:32 +0400 Subject: [PATCH 1/2] SearchModel --- .../BindingModels/UserBindingModel.cs | 19 +++++++++++++++++++ .../SearchModels/FurnitureSearchModel.cs | 14 ++++++++++++++ .../SearchModels/HeadsetModuleSearchModel.cs | 14 ++++++++++++++ .../SearchModels/MaterialSearchModel.cs | 14 ++++++++++++++ .../SearchModels/UserSearchModel.cs | 14 ++++++++++++++ .../Models/{User.cs => IUserModel.cs} | 2 +- 6 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 FurnitureFactory/FurnitureContracts/BindingModels/UserBindingModel.cs create mode 100644 FurnitureFactory/FurnitureContracts/SearchModels/FurnitureSearchModel.cs create mode 100644 FurnitureFactory/FurnitureContracts/SearchModels/HeadsetModuleSearchModel.cs create mode 100644 FurnitureFactory/FurnitureContracts/SearchModels/MaterialSearchModel.cs create mode 100644 FurnitureFactory/FurnitureContracts/SearchModels/UserSearchModel.cs rename FurnitureFactory/FurnitureFactoryDataModels/Models/{User.cs => IUserModel.cs} (90%) diff --git a/FurnitureFactory/FurnitureContracts/BindingModels/UserBindingModel.cs b/FurnitureFactory/FurnitureContracts/BindingModels/UserBindingModel.cs new file mode 100644 index 0000000..9aacac6 --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/BindingModels/UserBindingModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FurnitureFactoryDataModels.Models; +namespace FurnitureContracts.BindingModels +{ + internal class UserBindingModel : IUserModel + { + public int Login { get; set; } + + public int Password { get; set; } + + public string UserName { get; set; } = string.Empty; + + public int RoleID { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureContracts/SearchModels/FurnitureSearchModel.cs b/FurnitureFactory/FurnitureContracts/SearchModels/FurnitureSearchModel.cs new file mode 100644 index 0000000..b45a12d --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/SearchModels/FurnitureSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.SearchModels +{ + public class FurnitureSearchModel + { + public string? Name { get; set; } + public int? Id { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureContracts/SearchModels/HeadsetModuleSearchModel.cs b/FurnitureFactory/FurnitureContracts/SearchModels/HeadsetModuleSearchModel.cs new file mode 100644 index 0000000..3455e8b --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/SearchModels/HeadsetModuleSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.SearchModels +{ + internal class HeadsetModuleSearchModel + { + public string? Name { get; set; } + public int? Id { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureContracts/SearchModels/MaterialSearchModel.cs b/FurnitureFactory/FurnitureContracts/SearchModels/MaterialSearchModel.cs new file mode 100644 index 0000000..050f1fa --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/SearchModels/MaterialSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.SearchModels +{ + public class MaterialSearchModel + { + public string? Name { get; set; } + public int? Id { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureContracts/SearchModels/UserSearchModel.cs b/FurnitureFactory/FurnitureContracts/SearchModels/UserSearchModel.cs new file mode 100644 index 0000000..b57875a --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/SearchModels/UserSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.SearchModels +{ + internal class UserSearchModel + { + public string? Name { get; set; } + public int? Id { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureFactoryDataModels/Models/User.cs b/FurnitureFactory/FurnitureFactoryDataModels/Models/IUserModel.cs similarity index 90% rename from FurnitureFactory/FurnitureFactoryDataModels/Models/User.cs rename to FurnitureFactory/FurnitureFactoryDataModels/Models/IUserModel.cs index 96fe569..e5bf5ae 100644 --- a/FurnitureFactory/FurnitureFactoryDataModels/Models/User.cs +++ b/FurnitureFactory/FurnitureFactoryDataModels/Models/IUserModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace FurnitureFactoryDataModels.Models { - internal interface User + public interface IUserModel { int Login { get;} int Password { get; } From 26f6db4cbfb51fd410827e95e57b37d82abf8128 Mon Sep 17 00:00:00 2001 From: Ismailov_Rovshan Date: Wed, 5 Apr 2023 22:55:55 +0400 Subject: [PATCH 2/2] ViewModel --- .../ViewModel/FurnitureViewModel.cs | 26 +++++++++++++++++++ .../ViewModel/HeadsetModuleViewModel.cs | 22 ++++++++++++++++ .../ViewModel/HeadsetViewModel.cs | 1 + .../ViewModel/MaterialViewModel.cs | 23 ++++++++++++++++ .../ViewModel/SalesSalonsViewModel.cs | 2 +- .../ViewModel/UserViewModel.cs | 23 ++++++++++++++++ 6 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 FurnitureFactory/FurnitureContracts/ViewModel/FurnitureViewModel.cs create mode 100644 FurnitureFactory/FurnitureContracts/ViewModel/HeadsetModuleViewModel.cs create mode 100644 FurnitureFactory/FurnitureContracts/ViewModel/MaterialViewModel.cs create mode 100644 FurnitureFactory/FurnitureContracts/ViewModel/UserViewModel.cs diff --git a/FurnitureFactory/FurnitureContracts/ViewModel/FurnitureViewModel.cs b/FurnitureFactory/FurnitureContracts/ViewModel/FurnitureViewModel.cs new file mode 100644 index 0000000..e2e9f88 --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/ViewModel/FurnitureViewModel.cs @@ -0,0 +1,26 @@ +using FurnitureFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.ViewModel +{ + public class FurnitureViewModel : IFurnitureModel + { + [DisplayName("Название")] + public string Name { get; set; } = string.Empty; + [DisplayName("Цвет")] + + public string Color { get; set; } = string.Empty; + [DisplayName("Тип")] + + public string Type { get; set; } = string.Empty; + + public Dictionary FurnitureMaterial { get; set; } + + public int Id { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureContracts/ViewModel/HeadsetModuleViewModel.cs b/FurnitureFactory/FurnitureContracts/ViewModel/HeadsetModuleViewModel.cs new file mode 100644 index 0000000..4455263 --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/ViewModel/HeadsetModuleViewModel.cs @@ -0,0 +1,22 @@ +using FurnitureFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.ViewModel +{ + public class HeadsetModuleViewModel : IHeadsetModuleModel + { + [DisplayName("Стиль")] + public string Style { get; set; } = string.Empty; + [DisplayName("Цена")] + public int Cost { get; set; } + + public int UserID { get; set; } + + public int Id { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureContracts/ViewModel/HeadsetViewModel.cs b/FurnitureFactory/FurnitureContracts/ViewModel/HeadsetViewModel.cs index 428c441..7889927 100644 --- a/FurnitureFactory/FurnitureContracts/ViewModel/HeadsetViewModel.cs +++ b/FurnitureFactory/FurnitureContracts/ViewModel/HeadsetViewModel.cs @@ -10,6 +10,7 @@ namespace FurnitureContracts.ViewModel { public class HeadsetViewModel { + [DisplayName("Цена")] public int Cost { get; set; } [DisplayName("Размер")] diff --git a/FurnitureFactory/FurnitureContracts/ViewModel/MaterialViewModel.cs b/FurnitureFactory/FurnitureContracts/ViewModel/MaterialViewModel.cs new file mode 100644 index 0000000..c1d9d65 --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/ViewModel/MaterialViewModel.cs @@ -0,0 +1,23 @@ +using FurnitureFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.ViewModel +{ + + public class MaterialViewModel : IMaterialModel + { + [DisplayName("Название")] + public string Name { get; set; } = string.Empty; + [DisplayName("Цена")] + public int Cost { get; set; } + + public int userID { get; set; } + + public int Id { get; set; } + } +} diff --git a/FurnitureFactory/FurnitureContracts/ViewModel/SalesSalonsViewModel.cs b/FurnitureFactory/FurnitureContracts/ViewModel/SalesSalonsViewModel.cs index 9f45f70..5a06927 100644 --- a/FurnitureFactory/FurnitureContracts/ViewModel/SalesSalonsViewModel.cs +++ b/FurnitureFactory/FurnitureContracts/ViewModel/SalesSalonsViewModel.cs @@ -7,7 +7,7 @@ namespace FurnitureContracts.ViewModel { [DisplayName("Название")] public string Name { get; set; } = string.Empty; - [DisplayName("Адресс")] + [DisplayName("Адрес")] public string Address { get; set; } = string.Empty; public Dictionary OrdersId { get; set; } public int Id { get; set; } diff --git a/FurnitureFactory/FurnitureContracts/ViewModel/UserViewModel.cs b/FurnitureFactory/FurnitureContracts/ViewModel/UserViewModel.cs new file mode 100644 index 0000000..aa3ac44 --- /dev/null +++ b/FurnitureFactory/FurnitureContracts/ViewModel/UserViewModel.cs @@ -0,0 +1,23 @@ +using FurnitureFactoryDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureContracts.ViewModel +{ + internal class UserViewModel : IUserModel + { + [DisplayName("Логин")] + public int Login { get; set; } + [DisplayName("Пароль")] + public int Password { get; set; } + [DisplayName("Имя пользователя")] + + public string UserName { get; set; } = string.Empty; + + public int RoleID { get; set; } + } +}