diff --git a/SecuritySystem/SecuritySystemContracts/BindingModels/ComponentBindingModel.cs b/SecuritySystem/SecuritySystemContracts/BindingModels/ComponentBindingModel.cs new file mode 100644 index 0000000..3f01435 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/BindingModels/ComponentBindingModel.cs @@ -0,0 +1,11 @@ +using SecuritySystemDataModels.Models; + +namespace SecuritySystemContracts.BindingModels +{ + public class ComponentBindingModel : IComponentModel + { + public int Id { get; set; } + public string ComponentName { get; set; } = string.Empty; + public double Cost { get; set; } + } +} diff --git a/SecuritySystem/SecuritySystemContracts/BindingModels/OrderBindingModel.cs b/SecuritySystem/SecuritySystemContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..3ff6f27 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,16 @@ +using SecuritySystemDataModels.Enums; +using SecuritySystemDataModels.Models; + +namespace SecuritySystemContracts.BindingModels +{ + public class OrderBindingModel : IOrderModel + { + public int Id { get; set; } + public int SecureId { 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/SecuritySystem/SecuritySystemContracts/BindingModels/SecureBindingModel.cs b/SecuritySystem/SecuritySystemContracts/BindingModels/SecureBindingModel.cs new file mode 100644 index 0000000..b6e3cb8 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/BindingModels/SecureBindingModel.cs @@ -0,0 +1,12 @@ +using SecuritySystemDataModels.Models; + +namespace SecuritySystemContracts.BindingModels +{ + public class SecureBindingModel : ISecureModel + { + public int Id { get; set; } + public string SecureName { get; set; } = string.Empty; + public double Price { get; set; } + public Dictionary SecureComponents { get; set; } = new(); + } +} diff --git a/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IComponentLogic.cs b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IComponentLogic.cs new file mode 100644 index 0000000..48c12b3 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IComponentLogic.cs @@ -0,0 +1,15 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.ViewModels; + +namespace SecuritySystemContracts.BusinessLogicsContracts +{ + 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/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IOrderLogic.cs b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IOrderLogic.cs new file mode 100644 index 0000000..5017a75 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IOrderLogic.cs @@ -0,0 +1,15 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.ViewModels; + +namespace SecuritySystemContracts.BusinessLogicsContracts +{ + 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/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/ISecureLogic.cs b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/ISecureLogic.cs new file mode 100644 index 0000000..4162113 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/ISecureLogic.cs @@ -0,0 +1,15 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.ViewModels; + +namespace SecuritySystemContracts.BusinessLogicsContracts +{ + public interface ISecureLogic + { + List? ReadList(SecureSearchModel? model); + SecureViewModel? ReadElement(SecureSearchModel model); + bool Create(SecureBindingModel model); + bool Update(SecureBindingModel model); + bool Delete(SecureBindingModel model); + } +} diff --git a/SecuritySystem/SecuritySystemContracts/SearchModels/ComponentSearchModel.cs b/SecuritySystem/SecuritySystemContracts/SearchModels/ComponentSearchModel.cs new file mode 100644 index 0000000..71b6fb5 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/SearchModels/ComponentSearchModel.cs @@ -0,0 +1,8 @@ +namespace SecuritySystemContracts.SearchModels +{ + public class ComponentSearchModel + { + public int? Id { get; set; } + public string? ComponentName { get; set; } + } +} diff --git a/SecuritySystem/SecuritySystemContracts/SearchModels/OrderSearchModel.cs b/SecuritySystem/SecuritySystemContracts/SearchModels/OrderSearchModel.cs new file mode 100644 index 0000000..500fb59 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/SearchModels/OrderSearchModel.cs @@ -0,0 +1,7 @@ +namespace SecuritySystemContracts.SearchModels +{ + public class OrderSearchModel + { + public int? Id { get; set; } + } +} diff --git a/SecuritySystem/SecuritySystemContracts/SearchModels/SecureSearchModel.cs b/SecuritySystem/SecuritySystemContracts/SearchModels/SecureSearchModel.cs new file mode 100644 index 0000000..596ead5 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/SearchModels/SecureSearchModel.cs @@ -0,0 +1,8 @@ +namespace SecuritySystemContracts.SearchModels +{ + public class SecureSearchModel + { + public int? Id { get; set; } + public string? SecureName { get; set; } + } +} diff --git a/SecuritySystem/SecuritySystemContracts/SecuritySystemContracts.csproj b/SecuritySystem/SecuritySystemContracts/SecuritySystemContracts.csproj index 0237985..755c027 100644 --- a/SecuritySystem/SecuritySystemContracts/SecuritySystemContracts.csproj +++ b/SecuritySystem/SecuritySystemContracts/SecuritySystemContracts.csproj @@ -7,11 +7,7 @@ - - - - - + diff --git a/SecuritySystem/SecuritySystemContracts/StoragesContracts/IComponentStorage.cs b/SecuritySystem/SecuritySystemContracts/StoragesContracts/IComponentStorage.cs new file mode 100644 index 0000000..c28e617 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/StoragesContracts/IComponentStorage.cs @@ -0,0 +1,16 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.ViewModels; + +namespace SecuritySystemContracts.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/SecuritySystem/SecuritySystemContracts/StoragesContracts/IOrderStorage.cs b/SecuritySystem/SecuritySystemContracts/StoragesContracts/IOrderStorage.cs new file mode 100644 index 0000000..3d3941a --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/StoragesContracts/IOrderStorage.cs @@ -0,0 +1,16 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.ViewModels; + +namespace SecuritySystemContracts.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/SecuritySystem/SecuritySystemContracts/StoragesContracts/ISecureStorage.cs b/SecuritySystem/SecuritySystemContracts/StoragesContracts/ISecureStorage.cs new file mode 100644 index 0000000..21770d5 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/StoragesContracts/ISecureStorage.cs @@ -0,0 +1,16 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.ViewModels; + +namespace SecuritySystemContracts.StoragesContracts +{ + public interface ISecureStorage + { + List GetFullList(); + List GetFilteredList(SecureSearchModel model); + SecureViewModel? GetElement(SecureSearchModel model); + SecureViewModel? Insert(SecureBindingModel model); + SecureViewModel? Update(SecureBindingModel model); + SecureViewModel? Delete(SecureBindingModel model); + } +} diff --git a/SecuritySystem/SecuritySystemContracts/ViewModels/ComponentViewModel.cs b/SecuritySystem/SecuritySystemContracts/ViewModels/ComponentViewModel.cs new file mode 100644 index 0000000..852c89c --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/ViewModels/ComponentViewModel.cs @@ -0,0 +1,14 @@ +using SecuritySystemDataModels.Models; +using System.ComponentModel; + +namespace SecuritySystemContracts.ViewModels +{ + public class ComponentViewModel : IComponentModel + { + public int Id { get; set; } + [DisplayName("Название компонента")] + public string ComponentName { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Cost { get; set; } + } +} diff --git a/SecuritySystem/SecuritySystemContracts/ViewModels/OrderViewModel.cs b/SecuritySystem/SecuritySystemContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..1a300c0 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,25 @@ +using SecuritySystemDataModels.Enums; +using SecuritySystemDataModels.Models; +using System.ComponentModel; + +namespace SecuritySystemContracts.ViewModels +{ + public class OrderViewModel : IOrderModel + { + [DisplayName("Номер")] + public int Id { get; set; } + public int SecureId { get; set; } + [DisplayName("Изделие")] + public string SecureName { get; set; } = string.Empty; + [DisplayName("Количество")] + public int Count { get; set; } + [DisplayName("Сумма")] + public double Sum { get; set; } + [DisplayName("Статус")] + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + [DisplayName("Дата создания")] + public DateTime DateCreate { get; set; } = DateTime.Now; + [DisplayName("Дата выполнения")] + public DateTime? DateImplement { get; set; } + } +} diff --git a/SecuritySystem/SecuritySystemContracts/ViewModels/SecureViewModel.cs b/SecuritySystem/SecuritySystemContracts/ViewModels/SecureViewModel.cs new file mode 100644 index 0000000..3da5222 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/ViewModels/SecureViewModel.cs @@ -0,0 +1,15 @@ +using SecuritySystemDataModels.Models; +using System.ComponentModel; + +namespace SecuritySystemContracts.ViewModels +{ + public class SecureViewModel : ISecureModel + { + public int Id { get; set; } + [DisplayName("Название изделия")] + public string SecureName { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Price { get; set; } + public Dictionary SecureComponents { get; set; } = new(); + } +}