отчет номер 2
This commit is contained in:
parent
9bfbcc4815
commit
01ae38d58c
@ -106,28 +106,25 @@ namespace VeterinaryDatabaseImplement.Implements
|
||||
using var context = new VeterinaryDatabase();
|
||||
|
||||
return context.Medications
|
||||
.Select(pet => new ReportDrugsVisitsViewModel()
|
||||
{
|
||||
MedicationName = pet.MedicationName,
|
||||
Drugs = context.Drugs
|
||||
.Where(drug => drug.DateCreate <= model.DateTo &&
|
||||
drug.DateCreate >= model.DateFrom && drug.Medications
|
||||
.Select(x => x.MedicationId)
|
||||
.ToList()
|
||||
.Contains(pet.Id))
|
||||
.Select(drug => drug.GetViewModel)
|
||||
.ToList(),
|
||||
Visits = context.Services
|
||||
.Include(service => service.Visit)
|
||||
.Where(service => service.Visit!=null&&service.Visit.DateVisit <= model.DateTo &&
|
||||
service.Visit.DateVisit >= model.DateFrom && service.Medications
|
||||
.Select(x => x.MedicationId)
|
||||
.ToList()
|
||||
.Contains(pet.Id))
|
||||
.Select(service => service.Visit.GetViewModel)
|
||||
.ToList(),
|
||||
})
|
||||
.ToList();
|
||||
.Select(pet => new ReportDrugsVisitsViewModel()
|
||||
{
|
||||
MedicationName = pet.MedicationName,
|
||||
Drugs = context.Drugs
|
||||
.Where(drug => drug.DateCreate <= model.DateTo &&
|
||||
drug.DateCreate >= model.DateFrom && drug.Medications.Any(m => m.MedicationId == pet.Id))
|
||||
.Select(drug => drug.GetViewModel)
|
||||
.ToList(),
|
||||
Visits = context.Services
|
||||
.Include(service => service.Visit)
|
||||
.Where(service => service.Visit != null && service.Visit.DateVisit <= model.DateTo &&
|
||||
service.Visit.DateVisit >= model.DateFrom && service.Medications.Any(m => m.MedicationId == pet.Id))
|
||||
.Select(service => service.Visit.GetViewModel)
|
||||
.ToList(),
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -49,12 +49,11 @@ namespace VeterinaryDatabaseImplement.Implements
|
||||
using var context = new VeterinaryDatabase();
|
||||
return context.Pets
|
||||
.Where(pet => model.petsIds == null || model.petsIds.Contains(pet.Id))
|
||||
.Include()
|
||||
.Select(pet => new ReportServicesViewModel()
|
||||
{
|
||||
PetName = pet.PetName,
|
||||
Services = context.Services.Include(service => service.Visit).ThenInclude(visit => visit.Pets)
|
||||
.Where(service => service.Visit!=null&&service.Visit.Pets.Select(x => x.PetId).ToList().Contains(pet.Id))
|
||||
.Where(service => service.Visit!=null&&service.Visit.Pets.Any(p => p.PetId == pet.Id))
|
||||
.Select(service => service.GetViewModel).ToList()
|
||||
}).ToList();
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ namespace VeterinaryShowDoctorApp.Controllers
|
||||
string dateFromS = dateFrom.ToString("s", CultureInfo.InvariantCulture);
|
||||
string dateToS = dateTo.ToString("s", CultureInfo.InvariantCulture);
|
||||
result = APIDoctor.GetRequest<List<ReportDrugsVisitsViewModel>>
|
||||
($"api/report/getvisitsguidesreport?datefrom={dateFromS}&dateto={dateToS}&doctorid={APIDoctor.Doctor.Id}")!; // переделать
|
||||
($"api/report/getdrugsvisitsreport?datefrom={dateFromS}&dateto={dateToS}&doctorid={APIDoctor.Doctor.Id}")!;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -603,7 +603,7 @@ namespace VeterinaryShowDoctorApp.Controllers
|
||||
{
|
||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
||||
}
|
||||
APIDoctor.PostRequest("api/report/sendvisitsguidesreporttoemail", new ReportDrugsVisitsBindingModel // поменять
|
||||
APIDoctor.PostRequest("api/report/senddrugsvisitsreporttoemail", new ReportDrugsVisitsBindingModel
|
||||
{
|
||||
FileName = "C:\\ReportsCourseWork\\pdffile.pdf",
|
||||
DoctorId = APIDoctor.Doctor.Id,
|
||||
|
@ -437,8 +437,8 @@ namespace VeterinaryShowOwnerApp.Controllers
|
||||
APIOwner.PostRequest("api/reportowner/createservicelistwordfile", new ReportServicesBindingModel
|
||||
{
|
||||
Pets = pets,
|
||||
FileName = "C:\\ReportsCourseWork\\wordfile.docx"
|
||||
});
|
||||
FileName = "C:\\Users\\1\\Downloads\\wordfile.docx"
|
||||
});
|
||||
Response.Redirect("GetWordFile");
|
||||
}
|
||||
else
|
||||
@ -446,23 +446,23 @@ namespace VeterinaryShowOwnerApp.Controllers
|
||||
APIOwner.PostRequest("api/reportowner/createservicelistexcelfile", new ReportServicesBindingModel
|
||||
{
|
||||
Pets = pets,
|
||||
FileName = "C:\\ReportsCourseWork\\excelfile.xlsx"
|
||||
});
|
||||
FileName = "C:\\Users\\1\\Downloads\\excelfile.xlsx"
|
||||
});
|
||||
Response.Redirect("GetExcelFile");
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult GetWordFile()
|
||||
{
|
||||
return new PhysicalFileResult("C:\\ReportsCourseWork\\wordfile.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult GetWordFile()
|
||||
{
|
||||
return new PhysicalFileResult("C:\\Users\\1\\Downloads\\wordfile.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
}
|
||||
|
||||
public IActionResult GetExcelFile()
|
||||
{
|
||||
return new PhysicalFileResult("C:\\ReportsCourseWork\\excelfile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult GetExcelFile()
|
||||
{
|
||||
return new PhysicalFileResult("C:\\Users\\1\\Downloads\\excelfile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult Report()
|
||||
{
|
||||
ViewBag.Report = new List<ReportVisitsDrugsBindingModel>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user