Сдано

This commit is contained in:
Yunusov_Niyaz 2024-02-28 15:49:54 +04:00
parent e91d420d53
commit c3824273d5
3 changed files with 6 additions and 26 deletions

View File

@ -26,10 +26,7 @@ namespace CarRepairShopFileImplement.Implements
{
return new();
}
return source.Components
.Where(x => x.ComponentName.Contains(model.ComponentName))
.Select(x => x.GetViewModel)
.ToList();
return source.Components.Where(x => x.ComponentName.Contains(model.ComponentName)).Select(x => x.GetViewModel).ToList();
}
public ComponentViewModel? GetElement(ComponentSearchModel model)
{
@ -37,12 +34,7 @@ namespace CarRepairShopFileImplement.Implements
{
return null;
}
return source.Components
.FirstOrDefault(x =>
(!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName ==
model.ComponentName) ||
(model.Id.HasValue && x.Id == model.Id))
?.GetViewModel;
return source.Components.FirstOrDefault(x =>(!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName ==model.ComponentName) ||(model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public ComponentViewModel? Insert(ComponentBindingModel model)
{

View File

@ -25,10 +25,7 @@ namespace CarRepairShopFileImplement.Implements
{
return new();
}
return source.Orders
.Where(x => x.Id == model.Id)
.Select(x => AccessRepairStorage(x.GetViewModel))
.ToList();
return source.Orders.Where(x => x.Id == model.Id).Select(x => AccessRepairStorage(x.GetViewModel)).ToList();
}
public OrderViewModel? GetElement(OrderSearchModel model)
{
@ -36,8 +33,7 @@ namespace CarRepairShopFileImplement.Implements
{
return null;
}
return AccessRepairStorage(source.Orders
.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel);
return AccessRepairStorage(source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel);
}
public OrderViewModel? Insert(OrderBindingModel model)
{

View File

@ -26,10 +26,7 @@ namespace CarRepairShopFileImplement.Implements
{
return new();
}
return source.Repairs
.Where(x => x.RepairName.Contains(model.RepairName))
.Select(x => x.GetViewModel)
.ToList();
return source.Repairs.Where(x => x.RepairName.Contains(model.RepairName)).Select(x => x.GetViewModel).ToList();
}
public RepairViewModel? GetElement(RepairSearchModel model)
@ -38,12 +35,7 @@ namespace CarRepairShopFileImplement.Implements
{
return null;
}
return source.Repairs
.FirstOrDefault(x =>
(!string.IsNullOrEmpty(model.RepairName) && x.RepairName ==
model.RepairName) ||
(model.Id.HasValue && x.Id == model.Id))
?.GetViewModel;
return source.Repairs.FirstOrDefault(x =>(!string.IsNullOrEmpty(model.RepairName) && x.RepairName ==model.RepairName) ||(model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public RepairViewModel? Insert(RepairBindingModel model)