diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/StoreBindingModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/StoreBindingModel.cs new file mode 100644 index 0000000..27beff7 --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/BindingModels/StoreBindingModel.cs @@ -0,0 +1,17 @@ +using SoftwareInstallationDataModels.Models; + +namespace SofrwareInstallationContracts.BindingModels +{ + public class StoreBindingModel : IStoreModel + { + public string StoreName { get; set; } = string.Empty; + public string StoreAdress { get; set; } = string.Empty; + + public DateTime OpeningDate { get; set; } = DateTime.Now; + + public Dictionary Packages { get; set; } = new (); + + public int Id { get; set; } + + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IStoreLogic.cs b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IStoreLogic.cs new file mode 100644 index 0000000..06f9a76 --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/BusinessLogicsContracts/IStoreLogic.cs @@ -0,0 +1,17 @@ +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; +using SoftwareInstallationDataModels.Models; + +namespace SofrwareInstallationContracts.BusinessLogicsContracts +{ + public interface IStoreLogic + { + List? ReadList(StoreSearchModel? model); + StoreViewModel? ReadElement(StoreSearchModel model); + bool Create(StoreBindingModel model); + bool Update(StoreBindingModel model); + bool Delete(StoreBindingModel model); + bool AddPackage(StoreSearchModel model, IPackageModel package, int quantity); + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/StoreSearchModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/StoreSearchModel.cs new file mode 100644 index 0000000..3e7c33a --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/SearchModels/StoreSearchModel.cs @@ -0,0 +1,8 @@ +namespace SofrwareInstallationContracts.SearchModels +{ + public class StoreSearchModel + { + public int? Id { get; set; } + public string? StoreName { get; set; } + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IStoreStorage.cs b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IStoreStorage.cs new file mode 100644 index 0000000..c07f88f --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/StoragesContracts/IStoreStorage.cs @@ -0,0 +1,16 @@ +using SofrwareInstallationContracts.BindingModels; +using SofrwareInstallationContracts.SearchModels; +using SofrwareInstallationContracts.ViewModels; + +namespace SofrwareInstallationContracts.StoragesContracts +{ + public interface IStoreStorage + { + List GetFullList(); + List GetFilteredList(StoreSearchModel model); + StoreViewModel? GetElement(StoreSearchModel model); + StoreViewModel? Insert(StoreBindingModel model); + StoreViewModel? Update(StoreBindingModel model); + StoreViewModel? Delete(StoreBindingModel model); + } +} diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs index cd97df5..645511f 100644 --- a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/OrderViewModel.cs @@ -28,7 +28,5 @@ namespace SofrwareInstallationContracts.ViewModels [DisplayName("Дата выполнения")] public DateTime? DateImplement { get; set; } - - } } diff --git a/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/StoreViewModel.cs b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/StoreViewModel.cs new file mode 100644 index 0000000..87a7ff3 --- /dev/null +++ b/SoftwareInstallation/SofrwareInstallationContracts/ViewModels/StoreViewModel.cs @@ -0,0 +1,18 @@ +using SoftwareInstallationDataModels.Models; +using System.ComponentModel; + +namespace SofrwareInstallationContracts.ViewModels +{ + public class StoreViewModel : IStoreModel + { + public Dictionary Packages { get; set; } = new(); + public int Id { get; set; } + + [DisplayName("Название магазина")] + public string StoreName { get; set; } = string.Empty; + [DisplayName("Адрес магазина")] + public string StoreAdress { get; set; } = string.Empty; + [DisplayName("Дата открытия")] + public DateTime OpeningDate { get; set; } = DateTime.Now; + } +} diff --git a/SoftwareInstallation/SoftwareInstallationDataModels/Models/IStoreModel.cs b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IStoreModel.cs new file mode 100644 index 0000000..5422c7a --- /dev/null +++ b/SoftwareInstallation/SoftwareInstallationDataModels/Models/IStoreModel.cs @@ -0,0 +1,10 @@ +namespace SoftwareInstallationDataModels.Models +{ + public interface IStoreModel : IId + { + public string StoreName { get; set; } + public string StoreAdress { get; set; } + DateTime OpeningDate { get; } + Dictionary Packages { get; } + } +}