ворд работает(?)

This commit is contained in:
Галина Федоренко 2024-05-28 19:19:59 +04:00
parent 209784fc73
commit c508544699
5 changed files with 11 additions and 10 deletions

View File

@ -54,7 +54,7 @@ namespace LawFirmBusinessLogic.BusinessLogics
public List<ReportClientsConsultationViewModel> GetClientsConsultation(ReportBindingModel model) public List<ReportClientsConsultationViewModel> GetClientsConsultation(ReportBindingModel model)
{ {
var clients = _clientStorage.GetFilteredList(new ClientSearchModel { Id = model.ClientId }); 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 consultations = _consultationStorage.GetFullList();
var list = new List<ReportClientsConsultationViewModel>(); var list = new List<ReportClientsConsultationViewModel>();
@ -74,6 +74,7 @@ namespace LawFirmBusinessLogic.BusinessLogics
{ {
record.ConsultationDate = cons.ConsultationDate; record.ConsultationDate = cons.ConsultationDate;
record.ConsultationCost = cons.Cost; record.ConsultationCost = cons.Cost;
record.Consultations.Add(new(cons.ConsultationDate, cons.Cost));
} }
} }
} }
@ -188,7 +189,7 @@ namespace LawFirmBusinessLogic.BusinessLogics
var record = new ReportConsultationHearingViewModel var record = new ReportConsultationHearingViewModel
{ {
LawyerName = lawyer.FIO, LawyerName = lawyer.FIO,
Consultation = new List<(DateTime ConsultationDate, double Price)>(), //Consultation = new List<(DateTime ConsultationDate, double Price)>(),
Hearing = new List<(DateTime HearingDate, string Judge)>() Hearing = new List<(DateTime HearingDate, string Judge)>()
}; };
@ -196,7 +197,7 @@ namespace LawFirmBusinessLogic.BusinessLogics
{ {
if (consultation.ConsultationLawyers.ContainsKey(lawyer.Id)) 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) foreach (var hearing in hearings)

View File

@ -41,7 +41,7 @@ namespace LawFirmBusinessLogic.OfficePackages
{ {
ColumnName = "B", ColumnName = "B",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = consultation.Cost, Text = consultation.Cost.ToString(),
StyleInfo = StyleInfo =
ExcelStyleInfoType.TextWithBroder ExcelStyleInfoType.TextWithBroder
}); });

View File

@ -5,6 +5,6 @@
public string ClientFIO { get; set; } = string.Empty; public string ClientFIO { get; set; } = string.Empty;
public double? ConsultationCost { get; set; } public double? ConsultationCost { get; set; }
public DateTime? ConsultationDate { 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();
} }
} }

View File

@ -11,9 +11,9 @@ namespace LawFirmDatabaseImplement
{ {
if (optionsBuilder.IsConfigured == false) 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); base.OnConfiguring(optionsBuilder);
} }

View File

@ -30,7 +30,7 @@ namespace LawFirmRestApi.Controllers
{ {
DateFrom = report.DateFrom, DateFrom = report.DateFrom,
DateTo = report.DateTo, DateTo = report.DateTo,
FileName = "D:\\CourseWork\\pdfclientsreport.pdf", FileName = "E:\\reports\\pdfclientsreport.pdf",
ClientId = report.ClientId, ClientId = report.ClientId,
ExecutorId = report.ExecutorId, ExecutorId = report.ExecutorId,
}); });
@ -46,7 +46,7 @@ namespace LawFirmRestApi.Controllers
{ {
try 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) catch (Exception ex)
{ {
@ -59,7 +59,7 @@ namespace LawFirmRestApi.Controllers
{ {
try 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) catch (Exception ex)
{ {