ПИбд-21, Лёвушкина Анна, лаб6 простая #16

Closed
AnnaLioness wants to merge 3 commits from лаб6 into лаб5
2 changed files with 0 additions and 33 deletions
Showing only changes of commit a068fda7c7 - Show all commits

View File

@ -16,19 +16,6 @@ namespace AbstractLawFirmDatabaseImplement.Implements
{
public OrderViewModel? GetElement(OrderSearchModel model)
{
/*if (!model.Id.HasValue)
{
return null;
}
using var context = new AbstractLawFirmDatabase();
return context.Orders
.Include(x => x.Document)
.Include(x => x.Client)
.Include(x => x.Implementer)
.FirstOrDefault(x =>
(model.Status == null || model.Status != null && model.Status.Contains(x.Status)) &&
model.ImplementerId.HasValue && x.ImplementerId == model.ImplementerId ||
model.Id.HasValue && x.Id == model.Id)?.GetViewModel;*/
if (!model.Id.HasValue && (!model.ImplementerId.HasValue || !model.Status.HasValue))
{
return null;

View File

@ -75,26 +75,6 @@ namespace AbstractLawFirmListImplement.Implements
}
public OrderViewModel? GetElement(OrderSearchModel model)
{
/*if (!model.Id.HasValue)
{
return null;
}
foreach (var order in _source.Orders)
{
if (model.Id.HasValue && order.Id == model.Id)
{
return order.GetViewModel;
}
else if (model.ImplementerId.HasValue && model.Status != null && order.ImplementerId == model.ImplementerId && model.Status.Contains(order.Status))
{
return GetViewModel(order);
}
else if (model.ImplementerId.HasValue && model.ImplementerId == order.ImplementerId)
{
return GetViewModel(order);
}
}
return null;*/
if (!model.Id.HasValue)
{
return null;