Switch product to sushi
This commit is contained in:
parent
a87d95c92b
commit
3e25205bf6
@ -6,7 +6,7 @@ namespace SushiBarContracts.BindingModels
|
|||||||
public class OrderBindingModel : IOrderModel
|
public class OrderBindingModel : IOrderModel
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public int ProductId { get; set; }
|
public int SushiId { get; set; }
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
public double Sum { get; set; }
|
public double Sum { get; set; }
|
||||||
public OrderStatus Status { get; set; } = OrderStatus.Unknown;
|
public OrderStatus Status { get; set; } = OrderStatus.Unknown;
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
using SushiBarDataModels.Models;
|
|
||||||
|
|
||||||
namespace SushiBarContracts.BindingModels
|
|
||||||
{
|
|
||||||
public class ProductBindingModel : IProductModel
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public string ProductName { get; set; } = string.Empty;
|
|
||||||
public double Price { get; set; }
|
|
||||||
public Dictionary<int, (IComponentModel, int)> ProductComponents { get; set; } = new();
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,12 @@
|
|||||||
|
using SushiBarDataModels.Models;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class SushiBindingModel : ISushiModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string SushiName { get; set; } = string.Empty;
|
||||||
|
public double Price { get; set; }
|
||||||
|
public Dictionary<int, (IComponentModel, int)> SushiComponents { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
using SushiBarContracts.BindingModels;
|
|
||||||
using SushiBarContracts.SearchModels;
|
|
||||||
using SushiBarContracts.ViewModels;
|
|
||||||
|
|
||||||
namespace SushiBarContracts.BusinessLogicsContracts
|
|
||||||
{
|
|
||||||
public interface IProductLogic
|
|
||||||
{
|
|
||||||
List<ProductViewModel>? ReadList(ProductSearchModel? model);
|
|
||||||
ProductViewModel? ReadElement(ProductSearchModel model);
|
|
||||||
bool Create(ProductBindingModel model);
|
|
||||||
bool Update(ProductBindingModel model);
|
|
||||||
bool Delete(ProductBindingModel model);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,15 @@
|
|||||||
|
using SushiBarContracts.BindingModels;
|
||||||
|
using SushiBarContracts.SearchModels;
|
||||||
|
using SushiBarContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface ISushiLogic
|
||||||
|
{
|
||||||
|
List<SushiViewModel>? ReadList(SushiSearchModel? model);
|
||||||
|
SushiViewModel? ReadElement(SushiSearchModel model);
|
||||||
|
bool Create(SushiBindingModel model);
|
||||||
|
bool Update(SushiBindingModel model);
|
||||||
|
bool Delete(SushiBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
namespace SushiBarContracts.SearchModels
|
namespace SushiBarContracts.SearchModels
|
||||||
{
|
{
|
||||||
public class ProductSearchModel
|
public class SushiSearchModel
|
||||||
{
|
{
|
||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
public string? ProductName { get; set; }
|
public string? SushiName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,16 +0,0 @@
|
|||||||
using SushiBarContracts.BindingModels;
|
|
||||||
using SushiBarContracts.SearchModels;
|
|
||||||
using SushiBarContracts.ViewModels;
|
|
||||||
|
|
||||||
namespace SushiBarContracts.StoragesContracts
|
|
||||||
{
|
|
||||||
public interface IProductStorage
|
|
||||||
{
|
|
||||||
List<ProductViewModel> GetFullList();
|
|
||||||
List<ProductViewModel> GetFilteredList(ProductSearchModel model);
|
|
||||||
ProductViewModel? GetElement(ProductSearchModel model);
|
|
||||||
ProductViewModel? Insert(ProductBindingModel model);
|
|
||||||
ProductViewModel? Update(ProductBindingModel model);
|
|
||||||
ProductViewModel? Delete(ProductBindingModel model);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,16 @@
|
|||||||
|
using SushiBarContracts.BindingModels;
|
||||||
|
using SushiBarContracts.SearchModels;
|
||||||
|
using SushiBarContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.StoragesContracts
|
||||||
|
{
|
||||||
|
public interface ISushiStorage
|
||||||
|
{
|
||||||
|
List<SushiViewModel> GetFullList();
|
||||||
|
List<SushiViewModel> GetFilteredList(SushiSearchModel model);
|
||||||
|
SushiViewModel? GetElement(SushiSearchModel model);
|
||||||
|
SushiViewModel? Insert(SushiBindingModel model);
|
||||||
|
SushiViewModel? Update(SushiBindingModel model);
|
||||||
|
SushiViewModel? Delete(SushiBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -8,10 +8,10 @@ namespace SushiBarContracts.ViewModels
|
|||||||
{
|
{
|
||||||
[DisplayName("Number")]
|
[DisplayName("Number")]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public int ProductId { get; set; }
|
public int SushiId { get; set; }
|
||||||
|
|
||||||
[DisplayName("Product")]
|
[DisplayName("Product")]
|
||||||
public string ProductName { get; set; } = string.Empty;
|
public string SushiName { get; set; } = string.Empty;
|
||||||
|
|
||||||
[DisplayName("Count")]
|
[DisplayName("Count")]
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
@ -3,15 +3,15 @@ using System.ComponentModel;
|
|||||||
|
|
||||||
namespace SushiBarContracts.ViewModels
|
namespace SushiBarContracts.ViewModels
|
||||||
{
|
{
|
||||||
public class ProductViewModel : IProductModel
|
public class SushiViewModel : ISushiModel
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
[DisplayName("Name of Product")]
|
[DisplayName("Name of Product")]
|
||||||
public string ProductName { get; set; } = string.Empty;
|
public string SushiName { get; set; } = string.Empty;
|
||||||
|
|
||||||
[DisplayName("Cost")]
|
[DisplayName("Cost")]
|
||||||
public double Price { get; set; }
|
public double Price { get; set; }
|
||||||
public Dictionary<int, (IComponentModel, int)> ProductComponents { get; set; } = new();
|
public Dictionary<int, (IComponentModel, int)> SushiComponents { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ namespace SushiBarDataModels.Models
|
|||||||
{
|
{
|
||||||
public interface IOrderModel : IId
|
public interface IOrderModel : IId
|
||||||
{
|
{
|
||||||
int ProductId { get; }
|
int SushiId { get; }
|
||||||
int Count { get; }
|
int Count { get; }
|
||||||
double Sum { get; }
|
double Sum { get; }
|
||||||
OrderStatus Status { get; }
|
OrderStatus Status { get; }
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
namespace SushiBarDataModels.Models
|
|
||||||
{
|
|
||||||
public interface IProductModel : IId
|
|
||||||
{
|
|
||||||
string ProductName { get; }
|
|
||||||
double Price { get; }
|
|
||||||
Dictionary<int, (IComponentModel, int)> ProductComponents { get; }
|
|
||||||
}
|
|
||||||
}
|
|
9
SushiBar/SushiBarModels/Models/ISushiModel.cs
Normal file
9
SushiBar/SushiBarModels/Models/ISushiModel.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace SushiBarDataModels.Models
|
||||||
|
{
|
||||||
|
public interface ISushiModel : IId
|
||||||
|
{
|
||||||
|
string SushiName { get; }
|
||||||
|
double Price { get; }
|
||||||
|
Dictionary<int, (IComponentModel, int)> SushiComponents { get; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user