diff --git a/HardwareShop/HardwareShopContracts/BindingModels/BuildBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/BuildBindingModel.cs new file mode 100644 index 0000000..38f55a2 --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BindingModels/BuildBindingModel.cs @@ -0,0 +1,18 @@ +using FoodOrdersDataModels.Models; +using HardwareShopDataModels.Models; +using System.ComponentModel; +namespace FoodOrdersContracts.BindingModels +{ + public class BuildSearchModel : IBuildModel + { + public int Id { get; set; } + + public decimal Price { get; set; } + + public string BuildName { get; set; } = string.Empty; + + public int UserID { get; set; } + + public Dictionary? BuildComponents { get; set; } + } +} diff --git a/HardwareShop/HardwareShopContracts/BindingModels/ClientBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..7460fa9 --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,19 @@ +using FoodOrdersDataModels.Models; +using HardwareShopDataModels.Enums; +using System.ComponentModel; + +namespace FoodOrdersContracts.BindingModels +{ + public class ClientBindingModel : IClientModel + { + public int Id { get; set; } + + public string Login { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + + public UserRole Role { get; set; } = UserRole.Неизвестен; + } +} \ No newline at end of file diff --git a/HardwareShop/HardwareShopContracts/BindingModels/CommentBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/CommentBindingModel.cs new file mode 100644 index 0000000..4ef1db3 --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BindingModels/CommentBindingModel.cs @@ -0,0 +1,17 @@ +using FoodOrdersDataModels.Models; +using HardwareShopDataModels.Models; +using System.ComponentModel; + +namespace FoodOrdersContracts.BindingModels +{ + public class CommentSearchModel : ICommentModel + { + public int Id { get; set; } + + public string Text { get; set; } = string.Empty; + + public string BuildName { get; set; } = string.Empty; + + public int BuildID { get; set; } + } +} diff --git a/HardwareShop/HardwareShopContracts/BindingModels/ComponentBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/ComponentBindingModel.cs new file mode 100644 index 0000000..dc57fee --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BindingModels/ComponentBindingModel.cs @@ -0,0 +1,14 @@ +using HardwareShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FoodOrdersContracts.BindingModels +{ + public class ComponentSearchModel : IComponentModel + { + public int Id { get; set; } + } +} diff --git a/HardwareShop/HardwareShopContracts/BindingModels/GoodBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/GoodBindingModel.cs new file mode 100644 index 0000000..66f4f6f --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BindingModels/GoodBindingModel.cs @@ -0,0 +1,15 @@ +using FoodOrdersDataModels.Enums; +using HardwareShopDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FoodOrdersContracts.BindingModels +{ + public class GoodBindingModel : IGoodModel + { + public int Id { get; set; } + } +} diff --git a/HardwareShop/HardwareShopContracts/BindingModels/OrderBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..e79da5c --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,11 @@ +using FoodOrdersDataModels.Enums; +using FoodOrdersDataModels.Models; +using HardwareShopDataModels.Models; +using System.ComponentModel; +namespace FoodOrdersContracts.BindingModels +{ + public class OrderSearchModel : IOrderModel + { + public int Id { get; set; } + } +} diff --git a/HardwareShop/HardwareShopContracts/BindingModels/PurchaseBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/PurchaseBindingModel.cs new file mode 100644 index 0000000..d7fe33c --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BindingModels/PurchaseBindingModel.cs @@ -0,0 +1,29 @@ +using FoodOrdersDataModels.Enums; +using FoodOrdersDataModels.Models; +using HardwareShopDataModels.Models; +using System.ComponentModel; +namespace FoodOrdersContracts.BindingModels +{ + public class PurachaseViewModel : IPurchaseModel + { + public int Id { get; set; } + + [DisplayName("Цена")] + public decimal Sum { get; set; } + + [DisplayName("Статус покупки")] + public PurchaseStatus PurchaseStatus { get; set; } = PurchaseStatus.Неизвестен; + + [DisplayName("Дата оплаты")] + public DateTime? DatePurchase { get; set; } + + public int UserID { get; set; } + + [DisplayName("Email клиента")] + public string UserEmail { get; set; } = string.Empty; + + public Dictionary? PurchaseBuilds { get; set; } + + public Dictionary PurchaseGoods { get; set; } = new(); + } +} diff --git a/HardwareShop/HardwareShopContracts/ViewModels/BuildViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/BuildViewModel.cs index cd2887f..6146e13 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/BuildViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/BuildViewModel.cs @@ -17,5 +17,7 @@ namespace FoodOrdersContracts.ViewModels public string UserEmail { get; set; } = string.Empty; public int UserID { get; set; } + + public Dictionary? BuildComponents { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/ClientViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/ClientViewModel.cs index cfc58f7..81c30c2 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/ClientViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/ClientViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel; namespace FoodOrdersContracts.ViewModels { - public class ClientViewModel : IClientModel + public class ClientBindingModel : IClientModel { public int Id { get; set; } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs index e396318..a524375 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace FoodOrdersContracts.ViewModels { - public class GoodViewModel : IGoodModel + public class GoodBindingModel : IGoodModel { public int Id { get; set; } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/PurchaseViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/PurchaseViewModel.cs index 565d063..eaedf51 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/PurchaseViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/PurchaseViewModel.cs @@ -24,6 +24,6 @@ namespace FoodOrdersContracts.ViewModels public Dictionary? PurchaseBuilds { get; set; } - public Dictionary PurchaseGoods { get; set; } + public Dictionary PurchaseGoods { get; set; } = new(); } } diff --git a/HardwareShop/HardwareShopDataModels/Models/IBuildModel.cs b/HardwareShop/HardwareShopDataModels/Models/IBuildModel.cs index d20ee56..0976d31 100644 --- a/HardwareShop/HardwareShopDataModels/Models/IBuildModel.cs +++ b/HardwareShop/HardwareShopDataModels/Models/IBuildModel.cs @@ -14,5 +14,7 @@ namespace HardwareShopDataModels.Models string BuildName { get; } int UserID { get; } + + Dictionary? BuildComponents { get; } } }