From e0a3c1e1fdbdcba0aeb1a9f14b9e615773760253 Mon Sep 17 00:00:00 2001 From: Safgerd Date: Wed, 5 Apr 2023 21:24:46 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B0=D0=BA=D0=BE=D0=B2=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B1=D0=BE=D1=80=20=D0=B2=D1=80=D0=B0=D1=82=20=D0=A8=D1=82?= =?UTF-8?q?=D0=B5=D0=B9=D0=BD=D0=B0..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ConsignmentBindingModel.cs | 17 +++++++++++ .../BindingModels/OrderBindingModel.cs | 21 ++++++++++++++ .../BindingModels/RequestBindingModel.cs | 17 +++++++++++ .../BindingModels/UserBindingModel.cs | 21 ++++++++++++++ .../SearchModels/ConsignmentSearchModel.cs | 13 +++++++++ .../SearchModels/OrderSearchModel.cs | 17 +++++++++++ .../SearchModels/RequestSearchModel.cs | 14 +++++++++ .../SearchModels/UserSearchModel.cs | 15 ++++++++++ .../ViewModels/ConsignmentViewModel.cs | 22 ++++++++++++++ .../ViewModels/OrderViewModel.cs | 29 +++++++++++++++++++ .../ViewModels/RequestViewModel.cs | 12 ++++++++ .../ViewModels/UserViewModel.cs | 12 ++++++++ ComputerStoreDataModels/Enums/OrderType.cs | 1 + .../Enums/{EmployeeRole.cs => Role.cs} | 3 +- ComputerStoreDataModels/Models/IOrderModel.cs | 3 +- .../Models/IRequestModel.cs | 3 +- ComputerStoreDataModels/Models/IUserModel.cs | 2 +- 17 files changed, 217 insertions(+), 5 deletions(-) create mode 100644 ComputerStoreContracts/BindingModels/ConsignmentBindingModel.cs create mode 100644 ComputerStoreContracts/BindingModels/OrderBindingModel.cs create mode 100644 ComputerStoreContracts/BindingModels/RequestBindingModel.cs create mode 100644 ComputerStoreContracts/BindingModels/UserBindingModel.cs create mode 100644 ComputerStoreContracts/SearchModels/ConsignmentSearchModel.cs create mode 100644 ComputerStoreContracts/SearchModels/OrderSearchModel.cs create mode 100644 ComputerStoreContracts/SearchModels/RequestSearchModel.cs create mode 100644 ComputerStoreContracts/SearchModels/UserSearchModel.cs create mode 100644 ComputerStoreContracts/ViewModels/ConsignmentViewModel.cs create mode 100644 ComputerStoreContracts/ViewModels/OrderViewModel.cs create mode 100644 ComputerStoreContracts/ViewModels/RequestViewModel.cs create mode 100644 ComputerStoreContracts/ViewModels/UserViewModel.cs rename ComputerStoreDataModels/Enums/{EmployeeRole.cs => Role.cs} (83%) diff --git a/ComputerStoreContracts/BindingModels/ConsignmentBindingModel.cs b/ComputerStoreContracts/BindingModels/ConsignmentBindingModel.cs new file mode 100644 index 0000000..ddd858f --- /dev/null +++ b/ComputerStoreContracts/BindingModels/ConsignmentBindingModel.cs @@ -0,0 +1,17 @@ +using ComputerStoreDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.BindingModels +{ + public class ConsignmentBindingModel : IConsignmentModel + { + public int OrderID { get; set; } + public int ProductID { get; set; } + public double Price { get; set; } + public int Count { get; set; } + } +} diff --git a/ComputerStoreContracts/BindingModels/OrderBindingModel.cs b/ComputerStoreContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..01a30da --- /dev/null +++ b/ComputerStoreContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,21 @@ +using ComputerStoreDataModels.Enums; +using ComputerStoreDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.BindingModels +{ + public class OrderBindingModel : IOrderModel + { + public int ID { get; set; } + public double Price { get; set; } + public OrderType Type { get; set; } = OrderType.Unknown; + public OrderStatus Status { get; set; } = OrderStatus.Unknown; + public DateTime DateCreate { get; set; } = DateTime.Now; + public DateTime? DateImplement { get; set; } + public int UserID { get; set; } + } +} diff --git a/ComputerStoreContracts/BindingModels/RequestBindingModel.cs b/ComputerStoreContracts/BindingModels/RequestBindingModel.cs new file mode 100644 index 0000000..5b700e4 --- /dev/null +++ b/ComputerStoreContracts/BindingModels/RequestBindingModel.cs @@ -0,0 +1,17 @@ +using ComputerStoreDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.BindingModels +{ + public class RequestBindingModel : IRequestModel + { + public int ID { get; set; } + public int OrderID { get; set; } + public double Price { get; set; } + public int Count { get; set; } + } +} diff --git a/ComputerStoreContracts/BindingModels/UserBindingModel.cs b/ComputerStoreContracts/BindingModels/UserBindingModel.cs new file mode 100644 index 0000000..76c3cbd --- /dev/null +++ b/ComputerStoreContracts/BindingModels/UserBindingModel.cs @@ -0,0 +1,21 @@ +using ComputerStoreDataModels.Enums; +using ComputerStoreDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.BindingModels +{ + public class UserBindingModel : IUserModel + { + public int ID { get; set; } + public string Username { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + public string FirstName { get; set; } = string.Empty; + public string LastName { get; set; } = string.Empty; + public string MiddleName { get; set; } = string.Empty; + public Role Role { get; set; } = Role.Unknown; + } +} diff --git a/ComputerStoreContracts/SearchModels/ConsignmentSearchModel.cs b/ComputerStoreContracts/SearchModels/ConsignmentSearchModel.cs new file mode 100644 index 0000000..35e06b3 --- /dev/null +++ b/ComputerStoreContracts/SearchModels/ConsignmentSearchModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.SearchModels +{ + public class ConsignmentSearchModel + { + public int? OrderID { get; set; } + } +} diff --git a/ComputerStoreContracts/SearchModels/OrderSearchModel.cs b/ComputerStoreContracts/SearchModels/OrderSearchModel.cs new file mode 100644 index 0000000..121b21c --- /dev/null +++ b/ComputerStoreContracts/SearchModels/OrderSearchModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.SearchModels +{ + public class OrderSearchModel + { + public int? ID { get; set; } + public DateTime? DateFrom { get; set; } + public DateTime? DateTo { get; set; } + //Временно + public int? UserID { get; set; } + } +} diff --git a/ComputerStoreContracts/SearchModels/RequestSearchModel.cs b/ComputerStoreContracts/SearchModels/RequestSearchModel.cs new file mode 100644 index 0000000..0ecc43a --- /dev/null +++ b/ComputerStoreContracts/SearchModels/RequestSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.SearchModels +{ + public class RequestSearchModel + { + public int? ID { get; set; } + public int? OrderID { get; set; } + } +} diff --git a/ComputerStoreContracts/SearchModels/UserSearchModel.cs b/ComputerStoreContracts/SearchModels/UserSearchModel.cs new file mode 100644 index 0000000..6cfdba1 --- /dev/null +++ b/ComputerStoreContracts/SearchModels/UserSearchModel.cs @@ -0,0 +1,15 @@ +using ComputerStoreDataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.SearchModels +{ + public class UserSearchModel + { + public int? ID { get; set; } + public string? Username { get; set; } + } +} diff --git a/ComputerStoreContracts/ViewModels/ConsignmentViewModel.cs b/ComputerStoreContracts/ViewModels/ConsignmentViewModel.cs new file mode 100644 index 0000000..6b14a4a --- /dev/null +++ b/ComputerStoreContracts/ViewModels/ConsignmentViewModel.cs @@ -0,0 +1,22 @@ +using ComputerStoreDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.ViewModels +{ + public class ConsignmentViewModel : IConsignmentModel + { + [DisplayName("Order ID")] + public int OrderID { get; } + [DisplayName("Product ID")] + public int ProductID { get; } + [DisplayName("Price")] + public double Price { get; } + [DisplayName("Count")] + public int Count { get; } + } +} diff --git a/ComputerStoreContracts/ViewModels/OrderViewModel.cs b/ComputerStoreContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..1a2675a --- /dev/null +++ b/ComputerStoreContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,29 @@ +using ComputerStoreDataModels.Enums; +using ComputerStoreDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.ViewModels +{ + public class OrderViewModel : IOrderModel + { + [DisplayName("Order ID")] + public int ID { get; set; } + [DisplayName("Price")] + public double Price { get; set; } + [DisplayName("Type of order")] + public OrderType Type { get; set; } + [DisplayName("Status")] + public OrderStatus Status { get; set; } + [DisplayName("Creation date")] + public DateTime DateCreate { get; set; } + [DisplayName("Implementation date")] + public DateTime? DateImplement { get; set; } + [DisplayName("User ID")] + public int UserID { get; set; } + } +} diff --git a/ComputerStoreContracts/ViewModels/RequestViewModel.cs b/ComputerStoreContracts/ViewModels/RequestViewModel.cs new file mode 100644 index 0000000..76a4145 --- /dev/null +++ b/ComputerStoreContracts/ViewModels/RequestViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.ViewModels +{ + internal class RequestViewModel + { + } +} diff --git a/ComputerStoreContracts/ViewModels/UserViewModel.cs b/ComputerStoreContracts/ViewModels/UserViewModel.cs new file mode 100644 index 0000000..31a8e81 --- /dev/null +++ b/ComputerStoreContracts/ViewModels/UserViewModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ComputerStoreContracts.ViewModels +{ + internal class UserViewModel + { + } +} diff --git a/ComputerStoreDataModels/Enums/OrderType.cs b/ComputerStoreDataModels/Enums/OrderType.cs index 7846c90..39c549e 100644 --- a/ComputerStoreDataModels/Enums/OrderType.cs +++ b/ComputerStoreDataModels/Enums/OrderType.cs @@ -8,6 +8,7 @@ namespace ComputerStoreDataModels.Enums { public enum OrderType { + Unknown = -1, Consigment = 0, Request = 1 } diff --git a/ComputerStoreDataModels/Enums/EmployeeRole.cs b/ComputerStoreDataModels/Enums/Role.cs similarity index 83% rename from ComputerStoreDataModels/Enums/EmployeeRole.cs rename to ComputerStoreDataModels/Enums/Role.cs index 598f95f..9a3748a 100644 --- a/ComputerStoreDataModels/Enums/EmployeeRole.cs +++ b/ComputerStoreDataModels/Enums/Role.cs @@ -6,8 +6,9 @@ using System.Threading.Tasks; namespace ComputerStoreDataModels.Enums { - public enum EmployeeRole + public enum Role { + Unknown = -1, Guarantor = 0, Cotnractor = 1 } diff --git a/ComputerStoreDataModels/Models/IOrderModel.cs b/ComputerStoreDataModels/Models/IOrderModel.cs index da4bccf..5be599d 100644 --- a/ComputerStoreDataModels/Models/IOrderModel.cs +++ b/ComputerStoreDataModels/Models/IOrderModel.cs @@ -1,4 +1,5 @@ -using System; +using ComputerStoreDataModels.Enums; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/ComputerStoreDataModels/Models/IRequestModel.cs b/ComputerStoreDataModels/Models/IRequestModel.cs index edc373b..2139b18 100644 --- a/ComputerStoreDataModels/Models/IRequestModel.cs +++ b/ComputerStoreDataModels/Models/IRequestModel.cs @@ -6,10 +6,9 @@ using System.Threading.Tasks; namespace ComputerStoreDataModels.Models { - public interface IRequestModel + public interface IRequestModel : IID { int OrderID { get; } - int PCID { get; } double Price { get; } int Count { get; } } diff --git a/ComputerStoreDataModels/Models/IUserModel.cs b/ComputerStoreDataModels/Models/IUserModel.cs index 8dd5be4..35e7518 100644 --- a/ComputerStoreDataModels/Models/IUserModel.cs +++ b/ComputerStoreDataModels/Models/IUserModel.cs @@ -15,6 +15,6 @@ namespace ComputerStoreDataModels.Models string FirstName { get; } string LastName { get; } string MiddleName { get; } - EmployeeRole Role { get; } + Role Role { get; } } }