И еще выборки для отчета
This commit is contained in:
parent
b508661bac
commit
0f1f2d4f18
@ -11,5 +11,6 @@ namespace VetClinicContracts.SearchModels
|
||||
public int? Id { get; set; }
|
||||
public string? ServiceName { get; set; } = string.Empty;
|
||||
public int? PharmacistId { get; set; }
|
||||
public int? MedicineId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -16,5 +16,6 @@ namespace VetClinicContracts.SearchModels
|
||||
public string? DateVisit { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
public int? ServiceId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,8 @@ namespace VetClinicDataBaseImplement.Implements
|
||||
.Include(x => x.Medicines)
|
||||
.ThenInclude(x => x.Medicine)
|
||||
.Where(x => (string.IsNullOrEmpty(model.ServiceName) || x.ServiceName.Contains(model.ServiceName))
|
||||
&& (!model.PharmacistId.HasValue || x.PharmacistId == model.PharmacistId))
|
||||
&& (!model.PharmacistId.HasValue || x.PharmacistId == model.PharmacistId)
|
||||
&& (!model.MedicineId.HasValue || x.Medicines.Select(x => x.MedicineId).ToList().Contains(model.MedicineId.Value)))
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
|
@ -33,7 +33,8 @@ namespace VetClinicDataBaseImplement.Implements
|
||||
return context.Visits.Include(x => x.Admin).Include(x => x.Services)
|
||||
.ThenInclude(x => x.Service)
|
||||
.Where(x => (string.IsNullOrEmpty(model.NameVisit) || x.NameVisit.Contains(model.NameVisit))
|
||||
&& (!model.AdminId.HasValue || x.AdminId == model.AdminId))
|
||||
&& (!model.AdminId.HasValue || x.AdminId == model.AdminId)
|
||||
&& (!model.ServiceId.HasValue || x.Services.Select(x => x.ServiceId).ToList().Contains(model.ServiceId.Value)))
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user