add new models for store
This commit is contained in:
parent
9399daba9e
commit
ae4eef9254
@ -0,0 +1,13 @@
|
|||||||
|
using SushiBarDataModels.Models;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class StoreBindingModel
|
||||||
|
{
|
||||||
|
public string StoreName { get; set; } = string.Empty;
|
||||||
|
public string StoreAdress { get; set; } = string.Empty;
|
||||||
|
public DateTime OpeningDate { get; set; } = DateTime.Now;
|
||||||
|
public Dictionary<int, (ISushiModel, int)> Sushis { get; set; } = new();
|
||||||
|
public int Id { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
using SushiBarContracts.BindingModels;
|
||||||
|
using SushiBarContracts.SearchModels;
|
||||||
|
using SushiBarContracts.ViewModels;
|
||||||
|
using SushiBarDataModels.Models;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.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, ISushiModel sushi, int quantity);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
namespace SushiBarContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class StoreSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? StoreName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
using SushiBarContracts.BindingModels;
|
||||||
|
using SushiBarContracts.SearchModels;
|
||||||
|
using SushiBarContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.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);
|
||||||
|
}
|
||||||
|
}
|
18
SushiBar/SushiBarContracts/ViewModels/StoreViewModel.cs
Normal file
18
SushiBar/SushiBarContracts/ViewModels/StoreViewModel.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using SushiBarDataModels.Models;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class StoreViewModel : IStoreModel
|
||||||
|
{
|
||||||
|
public Dictionary<int, (ISushiModel, int)> Sushis { get; set; } = new();
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Name store")]
|
||||||
|
public string StoreName { get; set; } = string.Empty;
|
||||||
|
[DisplayName("Adress store")]
|
||||||
|
public string StoreAdress { get; set; } = string.Empty;
|
||||||
|
[DisplayName("Date opening")]
|
||||||
|
public DateTime OpeningDate { get; set; } = DateTime.Now;
|
||||||
|
}
|
||||||
|
}
|
10
SushiBar/SushiBarModels/Models/IStoreModel.cs
Normal file
10
SushiBar/SushiBarModels/Models/IStoreModel.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace SushiBarDataModels.Models
|
||||||
|
{
|
||||||
|
public interface IStoreModel : IId
|
||||||
|
{
|
||||||
|
public string StoreName { get; set; }
|
||||||
|
public string StoreAdress { get; set; }
|
||||||
|
DateTime OpeningDate { get; }
|
||||||
|
Dictionary<int, (ISushiModel, int)> Sushis { get; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user