ПИбд-21, Лёвушкина Анна, лаб6 простая #16
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user