diff --git a/LawFim/LawFirmBusinessLogic/BusinessLogics/ReportLogic.cs b/LawFim/LawFirmBusinessLogic/BusinessLogics/ReportLogic.cs index 9d5254a..5b48615 100644 --- a/LawFim/LawFirmBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/LawFim/LawFirmBusinessLogic/BusinessLogics/ReportLogic.cs @@ -54,7 +54,7 @@ namespace LawFirmBusinessLogic.BusinessLogics public List GetClientsConsultation(ReportBindingModel model) { var clients = _clientStorage.GetFilteredList(new ClientSearchModel { Id = model.ClientId }); - var cases = _caseStorage.GetFullList(); + var cases = _caseStorage.GetFilteredList(new CaseSearchModel { ExecutorId = model.ExecutorId }); var consultations = _consultationStorage.GetFullList(); var list = new List(); @@ -74,6 +74,7 @@ namespace LawFirmBusinessLogic.BusinessLogics { record.ConsultationDate = cons.ConsultationDate; record.ConsultationCost = cons.Cost; + record.Consultations.Add(new(cons.ConsultationDate, cons.Cost)); } } } @@ -188,7 +189,7 @@ namespace LawFirmBusinessLogic.BusinessLogics var record = new ReportConsultationHearingViewModel { LawyerName = lawyer.FIO, - Consultation = new List<(DateTime ConsultationDate, double Price)>(), + //Consultation = new List<(DateTime ConsultationDate, double Price)>(), Hearing = new List<(DateTime HearingDate, string Judge)>() }; @@ -196,7 +197,7 @@ namespace LawFirmBusinessLogic.BusinessLogics { if (consultation.ConsultationLawyers.ContainsKey(lawyer.Id)) { - record.Consultation.Add(new(consultation.ConsultationDate, consultation.Cost)); + // record.Consultation.Add(new(consultation.ConsultationDate, consultation.Cost)); } } foreach (var hearing in hearings) diff --git a/LawFim/LawFirmBusinessLogic/OfficePackages/AbstractSaveToExcelClientsConsultation.cs b/LawFim/LawFirmBusinessLogic/OfficePackages/AbstractSaveToExcelClientsConsultation.cs index 434f874..4555716 100644 --- a/LawFim/LawFirmBusinessLogic/OfficePackages/AbstractSaveToExcelClientsConsultation.cs +++ b/LawFim/LawFirmBusinessLogic/OfficePackages/AbstractSaveToExcelClientsConsultation.cs @@ -41,7 +41,7 @@ namespace LawFirmBusinessLogic.OfficePackages { ColumnName = "B", RowIndex = rowIndex, - Text = consultation.Cost, + Text = consultation.Cost.ToString(), StyleInfo = ExcelStyleInfoType.TextWithBroder }); diff --git a/LawFim/LawFirmContracts/ViewModels/ReportClientsConsultationViewModel.cs b/LawFim/LawFirmContracts/ViewModels/ReportClientsConsultationViewModel.cs index 1d7ee92..8262c00 100644 --- a/LawFim/LawFirmContracts/ViewModels/ReportClientsConsultationViewModel.cs +++ b/LawFim/LawFirmContracts/ViewModels/ReportClientsConsultationViewModel.cs @@ -5,6 +5,6 @@ public string ClientFIO { get; set; } = string.Empty; public double? ConsultationCost { get; set; } public DateTime? ConsultationDate { get; set; } - public List<(DateTime ConsultationDate, string Cost)> Consultations { get; set; } = new(); + public List<(DateTime ConsultationDate, double Cost)> Consultations { get; set; } = new(); } } diff --git a/LawFim/LawFirmDatabaseImplement/LawFirmDatabase.cs b/LawFim/LawFirmDatabaseImplement/LawFirmDatabase.cs index 022c99d..4d12370 100644 --- a/LawFim/LawFirmDatabaseImplement/LawFirmDatabase.cs +++ b/LawFim/LawFirmDatabaseImplement/LawFirmDatabase.cs @@ -11,9 +11,9 @@ namespace LawFirmDatabaseImplement { if (optionsBuilder.IsConfigured == false) { - //optionsBuilder.UseSqlServer(@"Data Source=ZIRAEL\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + optionsBuilder.UseSqlServer(@"Data Source=ZIRAEL\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); - optionsBuilder.UseSqlServer(@"Data Source=PC-Anna\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); + //optionsBuilder.UseSqlServer(@"Data Source=PC-Anna\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } diff --git a/LawFim/LawFirmRestApi/Controllers/ReportClientsController.cs b/LawFim/LawFirmRestApi/Controllers/ReportClientsController.cs index c78cc5b..6b2cefa 100644 --- a/LawFim/LawFirmRestApi/Controllers/ReportClientsController.cs +++ b/LawFim/LawFirmRestApi/Controllers/ReportClientsController.cs @@ -30,7 +30,7 @@ namespace LawFirmRestApi.Controllers { DateFrom = report.DateFrom, DateTo = report.DateTo, - FileName = "D:\\CourseWork\\pdfclientsreport.pdf", + FileName = "E:\\reports\\pdfclientsreport.pdf", ClientId = report.ClientId, ExecutorId = report.ExecutorId, }); @@ -46,7 +46,7 @@ namespace LawFirmRestApi.Controllers { try { - _reportLogic.SaveClientsConsultationToWordFile(new ReportBindingModel { ExecutorId = report.ExecutorId, FileName = "D:\\CourseWork\\wordclientsreport.docx", ClientId = report.ClientId }); + _reportLogic.SaveClientsConsultationToWordFile(new ReportBindingModel { ExecutorId = report.ExecutorId, FileName = "E:\\reports\\wordclientsreport.docx", ClientId = report.ClientId }); } catch (Exception ex) { @@ -59,7 +59,7 @@ namespace LawFirmRestApi.Controllers { try { - _reportLogic.SaveClientsConsultationToExcelFile(new ReportBindingModel { ExecutorId = report.ExecutorId, FileName = "D:\\CourseWork\\excelclientsreport.xlsx", ClientId = report.ClientId }); + _reportLogic.SaveClientsConsultationToExcelFile(new ReportBindingModel { ExecutorId = report.ExecutorId, FileName = "E:\\reports\\excelclientsreport.xlsx", ClientId = report.ClientId }); } catch (Exception ex) {