интерфейсы business для коммента и покупки + в модели поиска добавила поля id пользователей (ищем только из тех, что создавал сам пользователь)
This commit is contained in:
parent
4b1d26dfb5
commit
4719cf6c0f
@ -92,9 +92,9 @@ namespace ComputerHardwareStoreBusinessLogic.BusinessLogic
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.Date))
|
||||
if (string.IsNullOrEmpty(model.Text))
|
||||
{
|
||||
throw new ArgumentNullException("Нет даты у комментария", nameof(model.Date));
|
||||
throw new ArgumentNullException("Нет текста комментария", nameof(model.Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -92,10 +92,6 @@ namespace ComputerHardwareStoreBusinessLogic.BusinessLogic
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (model.DateCreate == null) // TODO чего блин, всмысле нет
|
||||
{
|
||||
throw new ArgumentNullException("Нет даты создания покупки", nameof(model.Date));
|
||||
}
|
||||
if (model.Cost <= 0)
|
||||
{
|
||||
throw new ArgumentNullException("Стоимость покупки должна быть больше 0", nameof(model.Cost));
|
||||
|
@ -0,0 +1,15 @@
|
||||
using ComputerHardwareStoreContracts.BindingModels;
|
||||
using ComputerHardwareStoreContracts.SearchModels;
|
||||
using ComputerHardwareStoreContracts.ViewModels;
|
||||
|
||||
namespace ComputerHardwareStoreContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IBuildLogic
|
||||
{
|
||||
List<BuildViewModel>? ReadList(BuildSearchModel? model);
|
||||
BuildViewModel? ReadElement(BuildSearchModel model);
|
||||
bool Create(BuildBindingModel model);
|
||||
bool Update(BuildBindingModel model);
|
||||
bool Delete(BuildBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using ComputerHardwareStoreContracts.BindingModels;
|
||||
using ComputerHardwareStoreContracts.SearchModels;
|
||||
using ComputerHardwareStoreContracts.ViewModels;
|
||||
|
||||
namespace ComputerHardwareStoreContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface ICommentLogic
|
||||
{
|
||||
List<CommentViewModel>? ReadList(CommentSearchModel? model);
|
||||
CommentViewModel? ReadElement(CommentSearchModel model);
|
||||
bool Create(CommentBindingModel model);
|
||||
bool Update(CommentBindingModel model);
|
||||
bool Delete(CommentBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using ComputerHardwareStoreContracts.BindingModels;
|
||||
using ComputerHardwareStoreContracts.SearchModels;
|
||||
using ComputerHardwareStoreContracts.ViewModels;
|
||||
|
||||
namespace ComputerHardwareStoreContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IPurchaseLogic
|
||||
{
|
||||
List<PurchaseViewModel>? ReadList(PurchaseSearchModel? model);
|
||||
PurchaseViewModel? ReadElement(PurchaseSearchModel model);
|
||||
bool Create(PurchaseBindingModel model);
|
||||
bool Update(PurchaseBindingModel model);
|
||||
bool Delete(PurchaseBindingModel model);
|
||||
}
|
||||
}
|
@ -4,12 +4,12 @@ using ComputerHardwareStoreContracts.ViewModels;
|
||||
|
||||
namespace ComputerHardwareStoreContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IStoreKeeperLogic
|
||||
public interface IStoreKeeperLogic
|
||||
{
|
||||
List<StoreKeeperViewModel>? ReadList(StoreKeeperSearchModel? model);
|
||||
StoreKeeperViewModel? ReadElement(StoreKeeperSearchModel model);
|
||||
bool Create(StoreKeeperBindingModel model);
|
||||
bool Update(StoreKeeperBindingModel model);
|
||||
bool Delete(StoreKeeperBindingModel model);
|
||||
}
|
||||
List<StoreKeeperViewModel>? ReadList(StoreKeeperSearchModel? model);
|
||||
StoreKeeperViewModel? ReadElement(StoreKeeperSearchModel model);
|
||||
bool Create(StoreKeeperBindingModel model);
|
||||
bool Update(StoreKeeperBindingModel model);
|
||||
bool Delete(StoreKeeperBindingModel model);
|
||||
}
|
||||
}
|
||||
|
@ -6,14 +6,6 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="BusinessLogicsContracts\IStoreKeeperLogic.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="BusinessLogicsContracts\IStoreKeeperLogic.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ComputerHardwareStoreDataModels\ComputerHardwareStoreDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -4,5 +4,6 @@
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public int? VendorId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -4,5 +4,6 @@
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public int? StoreKeeperId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -4,5 +4,6 @@
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public int? StoreKeeperId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
public class PurchaseSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public int? VendorId { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user