diff --git a/HardwareShop/HardwareShopContracts/BindingModels/ComponentBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/ComponentBindingModel.cs index 0f9cd80..429cbc9 100644 --- a/HardwareShop/HardwareShopContracts/BindingModels/ComponentBindingModel.cs +++ b/HardwareShop/HardwareShopContracts/BindingModels/ComponentBindingModel.cs @@ -1,14 +1,15 @@ using HardwareShopDataModels.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace HardwareShopContracts.BindingModels { public class ComponentBindingModel : IComponentModel { public int Id { get; set; } + + public string ComponentName { get; set; } = string.Empty; + + public double Cost { get; set; } + + public int UserId { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/BindingModels/GoodBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/GoodBindingModel.cs index 3adf80a..098d088 100644 --- a/HardwareShop/HardwareShopContracts/BindingModels/GoodBindingModel.cs +++ b/HardwareShop/HardwareShopContracts/BindingModels/GoodBindingModel.cs @@ -1,15 +1,21 @@ -using HardwareShopDataModels.Enums; -using HardwareShopDataModels.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using HardwareShopDataModels.Models; namespace HardwareShopContracts.BindingModels { public class GoodBindingModel : IGoodModel { public int Id { get; set; } + + public string GoodName { get; set; } = string.Empty; + + public double Price { get; set; } + + public int UserId { get; set; } + + public Dictionary GoodComponents + { + get; + set; + } = new(); } } diff --git a/HardwareShop/HardwareShopContracts/BindingModels/OrderBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/OrderBindingModel.cs index f75b3ca..c468c02 100644 --- a/HardwareShop/HardwareShopContracts/BindingModels/OrderBindingModel.cs +++ b/HardwareShop/HardwareShopContracts/BindingModels/OrderBindingModel.cs @@ -1,11 +1,24 @@ using HardwareShopDataModels.Enums; using HardwareShopDataModels.Models; -using HardwareShopDataModels.Models; -using System.ComponentModel; + namespace HardwareShopContracts.BindingModels { public class OrderBindingModel : IOrderModel { public int Id { get; set; } + + public int GoodId { get; set; } + + public int UserId { get; set; } + + public int Count { get; set; } + + public double Sum { get; set; } + + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + + public DateTime DateCreate { get; set; } = DateTime.Now; + + public DateTime? DateImplement { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/BindingModels/UserBindingModel.cs b/HardwareShop/HardwareShopContracts/BindingModels/UserBindingModel.cs index 12cc6bf..74cf91e 100644 --- a/HardwareShop/HardwareShopContracts/BindingModels/UserBindingModel.cs +++ b/HardwareShop/HardwareShopContracts/BindingModels/UserBindingModel.cs @@ -1,6 +1,5 @@ using HardwareShopDataModels.Models; using HardwareShopDataModels.Enums; -using System.ComponentModel; namespace HardwareShopContracts.BindingModels { diff --git a/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IComponentLogic.cs b/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IComponentLogic.cs new file mode 100644 index 0000000..1c0c35a --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IComponentLogic.cs @@ -0,0 +1,15 @@ +using HardwareShopContracts.BindingModels; +using HardwareShopContracts.SearchModels; +using HardwareShopContracts.ViewModels; + +namespace HardwareShopContracts.BuisnessLogicsContracts +{ + public interface IComponentLogic + { + List? ReadList(ComponentSearchModel? model); + ComponentViewModel? ReadElement(ComponentSearchModel model); + bool Create(ComponentBindingModel model); + bool Update(ComponentBindingModel model); + bool Delete(ComponentBindingModel model); + } +} diff --git a/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IGoodLogic.cs b/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IGoodLogic.cs new file mode 100644 index 0000000..2103997 --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IGoodLogic.cs @@ -0,0 +1,15 @@ +using HardwareShopContracts.BindingModels; +using HardwareShopContracts.SearchModels; +using HardwareShopContracts.ViewModels; + +namespace HardwareShopContracts.BuisnessLogicsContracts +{ + public interface IGoodLogic + { + List? ReadList(GoodSearchModel? model); + GoodViewModel? ReadElement(GoodSearchModel model); + bool Create(GoodBindingModel model); + bool Update(GoodBindingModel model); + bool Delete(GoodBindingModel model); + } +} diff --git a/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IOrderLogic.cs b/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IOrderLogic.cs new file mode 100644 index 0000000..0b84dfc --- /dev/null +++ b/HardwareShop/HardwareShopContracts/BuisnessLogicsContracts/IOrderLogic.cs @@ -0,0 +1,15 @@ +using HardwareShopContracts.BindingModels; +using HardwareShopContracts.SearchModels; +using HardwareShopContracts.ViewModels; + +namespace HardwareShopContracts.BuisnessLogicsContracts +{ + 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/HardwareShop/HardwareShopContracts/SearchModels/ComponentSearchModel.cs b/HardwareShop/HardwareShopContracts/SearchModels/ComponentSearchModel.cs index bf726a8..0afab32 100644 --- a/HardwareShop/HardwareShopContracts/SearchModels/ComponentSearchModel.cs +++ b/HardwareShop/HardwareShopContracts/SearchModels/ComponentSearchModel.cs @@ -1,14 +1,8 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HardwareShopContracts.SearchModels +namespace HardwareShopContracts.SearchModels { public class ComponentSearchModel { public int? Id { get; set; } + public string? ComponentName { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/SearchModels/GoodSearchModel.cs b/HardwareShop/HardwareShopContracts/SearchModels/GoodSearchModel.cs index a2fc944..6f44638 100644 --- a/HardwareShop/HardwareShopContracts/SearchModels/GoodSearchModel.cs +++ b/HardwareShop/HardwareShopContracts/SearchModels/GoodSearchModel.cs @@ -1,14 +1,8 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HardwareShopContracts.SearchModels +namespace HardwareShopContracts.SearchModels { public class GoodSearchModel { public int? Id { get; set; } + public string? GoodName { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/SearchModels/OrderSearchModel.cs b/HardwareShop/HardwareShopContracts/SearchModels/OrderSearchModel.cs index ef4f856..59a7ebc 100644 --- a/HardwareShop/HardwareShopContracts/SearchModels/OrderSearchModel.cs +++ b/HardwareShop/HardwareShopContracts/SearchModels/OrderSearchModel.cs @@ -1,9 +1,9 @@ - -using System.ComponentModel; -namespace HardwareShopContracts.SearchModels +namespace HardwareShopContracts.SearchModels { public class OrderSearchModel { public int? Id { get; set; } + public DateTime? DateFrom { get; set; } + public DateTime? DateTo { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/StoragesContracts/IComponentStorage.cs b/HardwareShop/HardwareShopContracts/StoragesContracts/IComponentStorage.cs new file mode 100644 index 0000000..bf1430d --- /dev/null +++ b/HardwareShop/HardwareShopContracts/StoragesContracts/IComponentStorage.cs @@ -0,0 +1,16 @@ +using HardwareShopContracts.BindingModels; +using HardwareShopContracts.SearchModels; +using HardwareShopContracts.ViewModels; + +namespace HardwareShopContracts.StoragesContracts +{ + public interface IComponentStorage + { + List GetFullList(); + List GetFilteredList(ComponentSearchModel model); + ComponentViewModel? GetElement(ComponentSearchModel model); + ComponentViewModel? Insert(ComponentBindingModel model); + ComponentViewModel? Update(ComponentBindingModel model); + ComponentViewModel? Delete(ComponentBindingModel model); + } +} diff --git a/HardwareShop/HardwareShopContracts/StoragesContracts/IGoodStorage.cs b/HardwareShop/HardwareShopContracts/StoragesContracts/IGoodStorage.cs new file mode 100644 index 0000000..d579992 --- /dev/null +++ b/HardwareShop/HardwareShopContracts/StoragesContracts/IGoodStorage.cs @@ -0,0 +1,16 @@ +using HardwareShopContracts.BindingModels; +using HardwareShopContracts.SearchModels; +using HardwareShopContracts.ViewModels; + +namespace HardwareShopContracts.StoragesContracts +{ + public interface IGoodStorage + { + List GetFullList(); + List GetFilteredList(GoodSearchModel model); + GoodViewModel? GetElement(GoodSearchModel model); + GoodViewModel? Insert(GoodBindingModel model); + GoodViewModel? Update(GoodBindingModel model); + GoodViewModel? Delete(GoodBindingModel model); + } +} diff --git a/HardwareShop/HardwareShopContracts/StoragesContracts/IOrderStorage.cs b/HardwareShop/HardwareShopContracts/StoragesContracts/IOrderStorage.cs new file mode 100644 index 0000000..b1d3561 --- /dev/null +++ b/HardwareShop/HardwareShopContracts/StoragesContracts/IOrderStorage.cs @@ -0,0 +1,16 @@ +using HardwareShopContracts.BindingModels; +using HardwareShopContracts.SearchModels; +using HardwareShopContracts.ViewModels; + +namespace HardwareShopContracts.StoragesContracts +{ + public interface IOrderStorage + { + List GetFullList(); + List GetFilteredList(OrderSearchModel model); + OrderViewModel? GetElement(OrderSearchModel model); + OrderViewModel? Insert(OrderBindingModel model); + OrderViewModel? Update(OrderBindingModel model); + OrderViewModel? Delete(OrderBindingModel model); + } +} diff --git a/HardwareShop/HardwareShopContracts/StoragesContracts/IUserStorage.cs b/HardwareShop/HardwareShopContracts/StoragesContracts/IUserStorage.cs index e81bfee..9290aef 100644 --- a/HardwareShop/HardwareShopContracts/StoragesContracts/IUserStorage.cs +++ b/HardwareShop/HardwareShopContracts/StoragesContracts/IUserStorage.cs @@ -7,15 +7,10 @@ namespace HardwareShopContracts.StoragesContracts public interface IUserStorage { List GetFullList(); - List GetFilteredList(UserSearchModel model); - UserViewModel? GetElement(UserSearchModel model); - UserViewModel? Insert(UserBindingModel model); - UserViewModel? Update(UserBindingModel model); - UserViewModel? Delete(UserBindingModel model); } } \ No newline at end of file diff --git a/HardwareShop/HardwareShopContracts/ViewModels/ComponentViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/ComponentViewModel.cs index 8f5d476..86ba583 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/ComponentViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/ComponentViewModel.cs @@ -1,14 +1,17 @@ using HardwareShopDataModels.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel; namespace HardwareShopContracts.ViewModels { public class ComponentViewModel : IComponentModel { public int Id { get; set; } + [DisplayName("Компонент")] + public string ComponentName { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Cost { get; set; } + public int UserId { get; set; } + [DisplayName("Логин кладовщика")] + public string UserLogin { get; set; } = string.Empty; } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs index cb80615..c303fb5 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs @@ -1,15 +1,22 @@ - -using HardwareShopDataModels.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using HardwareShopDataModels.Models; +using System.ComponentModel; namespace HardwareShopContracts.ViewModels { public class GoodViewModel : IGoodModel { public int Id { get; set; } + [DisplayName("Товар")] + public string GoodName { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Price { get; set; } + public int UserId { get; set; } + [DisplayName("Логин кладовщика")] + public string UserLogin { get; set; } = string.Empty; + public Dictionary GoodComponents + { + get; + set; + } = new(); } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/OrderViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/OrderViewModel.cs index 6d9c308..e216594 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/OrderViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/OrderViewModel.cs @@ -1,10 +1,28 @@ using HardwareShopDataModels.Enums; using HardwareShopDataModels.Models; using System.ComponentModel; + namespace HardwareShopContracts.ViewModels { public class OrderViewModel : IOrderModel { + [DisplayName("Номер")] public int Id { get; set; } + public int GoodId { get; set; } + public int UserId { get; set; } + [DisplayName("Комлектующая")] + public string GoodName { get; set; } = string.Empty; + [DisplayName("Логин кладовщика")] + public string UserLogin { get; set; } = string.Empty; + [DisplayName("Количество")] + public int Count{ get; set; } + [DisplayName("Сумма")] + public double Sum{ get; set; } + [DisplayName("Статус")] + public OrderStatus Status{ get; set; } + [DisplayName("Дата создания")] + public DateTime DateCreate{ get; set; } + [DisplayName("Дата выполнения")] + public DateTime? DateImplement{ get; set; } } }