бебра
This commit is contained in:
parent
c0fe740dc9
commit
51cc93b256
@ -13,8 +13,5 @@ namespace VetClinicContracts.SearchModels
|
||||
public int? AdminId { get; set; }
|
||||
public string? AnimalName { get; set; }
|
||||
public string? Family { get; set; }
|
||||
public int? MedicineId { get; set; }
|
||||
|
||||
public int? VisitId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -16,8 +16,5 @@ namespace VetClinicContracts.SearchModels
|
||||
public string? DateVisit { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
public int? ServiceId { get; set; }
|
||||
|
||||
public int? AnimalId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,7 @@ namespace VetClinicDataBaseImplement.Implements
|
||||
return context.Visits.Include(x => x.Admin).Include(x => x.Services)
|
||||
.ThenInclude(x => x.Service).Include(x => x.Animals).ThenInclude(x => x.Animal)
|
||||
.Where(x => (string.IsNullOrEmpty(model.NameVisit) || x.NameVisit.Contains(model.NameVisit))
|
||||
&& (!model.AdminId.HasValue || x.AdminId == model.AdminId)
|
||||
&& (!model.ServiceId.HasValue || x.Services.Select(x => x.ServiceId).ToList().Contains(model.ServiceId.Value)))
|
||||
&& (!model.AdminId.HasValue || x.AdminId == model.AdminId))
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
@ -53,7 +52,7 @@ namespace VetClinicDataBaseImplement.Implements
|
||||
.Include(animal => animal.Visit).Where(animal => visit.Id == animal.VisitId).
|
||||
Select(animal => new Tuple<AnimalViewModel, List<VaccinationViewModel>>(animal.Animal.GetViewModel,
|
||||
context.Vaccinations.Include(x => x.Animal).Where(x => x.AnimalId == animal.AnimalId && x.DateStamp >= model.DateFrom && x.DateStamp <= model.DateTo).
|
||||
Select(x => x.GetViewModel).ToList())).ToList()).ToList();
|
||||
Select(x => x.GetViewModel).ToList())).ToList())).ToList();
|
||||
|
||||
}
|
||||
public List<Tuple<VisitViewModel, List<Tuple<AnimalViewModel, List<MedicineViewModel>>>>> GetMedicinesInfo(MedicineVaccinationsSearchModel model)
|
||||
|
Loading…
Reference in New Issue
Block a user