Zhimolostnova A.V. Hard lab work 1 #4

Closed
AnnZhimol wants to merge 5 commits from LabRab_1_Hard into LabRab_1
7 changed files with 86 additions and 2 deletions
Showing only changes of commit 0bfe8b692c - Show all commits

View File

@ -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<int, (IPackageModel, int)> Packages { get; set; } = new ();
public int Id { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using SofrwareInstallationContracts.BindingModels;
using SofrwareInstallationContracts.SearchModels;
using SofrwareInstallationContracts.ViewModels;
using SoftwareInstallationDataModels.Models;
namespace SofrwareInstallationContracts.BusinessLogicsContracts
{
public interface IStoreLogic
{
List<StoreViewModel>? 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);
}
}

View File

@ -0,0 +1,8 @@
namespace SofrwareInstallationContracts.SearchModels
{
public class StoreSearchModel
{
public int? Id { get; set; }
public string? StoreName { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using SofrwareInstallationContracts.BindingModels;
using SofrwareInstallationContracts.SearchModels;
using SofrwareInstallationContracts.ViewModels;
namespace SofrwareInstallationContracts.StoragesContracts
{
public interface IStoreStorage
{
List<StoreViewModel> GetFullList();
List<StoreViewModel> GetFilteredList(StoreSearchModel model);
StoreViewModel? GetElement(StoreSearchModel model);
StoreViewModel? Insert(StoreBindingModel model);
StoreViewModel? Update(StoreBindingModel model);
StoreViewModel? Delete(StoreBindingModel model);
}
}

View File

@ -28,7 +28,5 @@ namespace SofrwareInstallationContracts.ViewModels
[DisplayName("Дата выполнения")]
public DateTime? DateImplement { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using SoftwareInstallationDataModels.Models;
using System.ComponentModel;
namespace SofrwareInstallationContracts.ViewModels
{
public class StoreViewModel : IStoreModel
{
public Dictionary<int, (IPackageModel, int)> 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;
}
}

View File

@ -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<int, (IPackageModel, int)> Packages { get; }
}
}