This commit is contained in:
Галина Федоренко 2024-05-30 12:17:19 +04:00
commit 650397cecf
4 changed files with 45 additions and 12 deletions

View File

@ -1,4 +1,5 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.BusinessLogicContracts;
using LawFirmContracts.ViewModels;
using LawFirmGuarantorApp.Models;
using Microsoft.AspNetCore.Mvc;
@ -10,10 +11,12 @@ namespace LawFirmGuarantorApp.Controllers
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly IReportLogic _report;
public HomeController(ILogger<HomeController> logger)
public HomeController(ILogger<HomeController> logger, IReportLogic report)
{
_logger = logger;
_report = report;
}
// СТРАНИЦЫ КОНСУЛЬТАЦИЙ
@ -168,11 +171,12 @@ namespace LawFirmGuarantorApp.Controllers
List<ReportConsultationHearingViewModel> result;
try
{
string dateFromS = dateFrom.ToString("s", CultureInfo.InvariantCulture);
string dateToS = dateTo.ToString("s", CultureInfo.InvariantCulture);
result = APIClient.GetRequest<List<ReportConsultationHearingViewModel>>
($"api/reportguarantor/getconsultationhearingreport?datefrom={dateFromS}&dateto={dateToS}&guarantorid={APIClient.Guarantor.Id}")!;
result = _report.GetConsultationHearing(new ReportConsultationHearingBindingModel
{
GuarantorId = APIClient.Guarantor.Id,
DateFrom = dateFrom,
DateTo = dateTo
});
}
catch (Exception ex)
{

View File

@ -11,6 +11,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LawFimDataModels\LawFimDataModels.csproj" />
<ProjectReference Include="..\LawFirmBusinessLogic\LawFirmBusinessLogic.csproj" />
<ProjectReference Include="..\LawFirmContracts\LawFirmContracts.csproj" />
<ProjectReference Include="..\LawFirmDatabaseImplement\LawFirmDatabaseImplement.csproj" />
</ItemGroup>

View File

@ -1,11 +1,38 @@
using LawFirmContracts.BusinessLogicContracts;
using LawFirmContracts.StoragesContracts;
using LawFirmDatabaseImplement.Implements;
using LawFirmGuarantorApp;
using LawFirmBusinessLogic.BusinessLogics;
using LawFirmBusinessLogic.OfficePackages;
using LawFirmBusinessLogic.MailWorker;
using LawFirmBusinessLogic.OfficePackages.Implements;
var builder = WebApplication.CreateBuilder(args);
//builder.Services.AddTransient<IConsultationStorage, ConsultationStorage>();
//builder.Services.AddTransient<IHearingStorage, HearingStorage>();
//builder.Services.AddTransient<ILawyerStorage, LawyerStorage>();
builder.Services.AddTransient<IReportLogic, ReportLogic>();
builder.Services.AddTransient<IClientStorage, ClientStorage>();
builder.Services.AddTransient<IHearingStorage, HearingStorage>();
builder.Services.AddTransient<IVisitStorage, VisitStorage>();
builder.Services.AddTransient<ICaseStorage, CaseStorage>();
builder.Services.AddTransient<IConsultationStorage, ConsultationStorage>();
builder.Services.AddTransient<ILawyerStorage, LawyerStorage>();
builder.Services.AddTransient<IExecutorLogic, ExecutorLogic>();
builder.Services.AddTransient<IGuarantorLogic, GuarantorLogic>();
builder.Services.AddTransient<IExecutorStorage, ExecutorStorage>();
builder.Services.AddTransient<IGuarantorStorage, GuarantorStorage>();
builder.Services.AddTransient<AbstractSaveToExcelClientsConsultation, SaveToExcelClientsConsultation>();
builder.Services.AddTransient<AbstractSaveToExcelVisitsLawyer, SaveToExcelVisitsLawyer>();
builder.Services.AddTransient<AbstractSaveToWordClientsConsultation, SaveToWordClientsConsultation>();
builder.Services.AddTransient<AbstractSaveToWordVisitsLawyer, SaveToWordVisitsLawyer>();
builder.Services.AddTransient<AbstractSaveToPdfConsultationHearing, SaveToPdfConsultationHearing>();
builder.Services.AddTransient<AbstractSaveToPdfCaseHearing, SaveToPdfCaseHearing>();
builder.Services.AddTransient<AbstractSaveToPdfClients, SaveToPdfClients>();
builder.Services.AddTransient<AbstractSaveToPdfClientCaseHearing, SaveToPdfClientCaseHearing>();
builder.Services.AddSingleton<AbstractMailWorker, MailKitWorker>();
// Add services to the container.
builder.Services.AddControllersWithViews();

View File

@ -32,7 +32,7 @@ namespace LawFirmRestApi.Controllers
{
DateFrom = report.DateFrom,
DateTo = report.DateTo,
FileName = "E:\\reports\\pdfConsultationHearingsReport.pdf",
FileName = "D:\\CourseWork\\pdfConsultationHearingsReport.pdf",
GuarantorId = report.GuarantorId,
});
}
@ -51,7 +51,7 @@ namespace LawFirmRestApi.Controllers
{
DateFrom = report.DateFrom,
DateTo = report.DateTo,
FileName = "E:\\reports\\pdfCaseHearingsReport.pdf",
FileName = "D:\\CourseWork\\pdfCaseHearingsReport.pdf",
GuarantorId = report.GuarantorId,
LawyerId =report.LawyerId,
});
@ -70,7 +70,7 @@ namespace LawFirmRestApi.Controllers
_reportLogic.SaveVisitLawyerToWordFile(new ReportVisitLawyerBindingModel
{
GuarantorId = report.GuarantorId,
FileName = "E:\\reports\\wordVisitLawyerReport.docx",
FileName = "D:\\CourseWork\\wordVisitLawyerReport.docx",
LawyerId = report.LawyerId
});
}
@ -88,7 +88,7 @@ namespace LawFirmRestApi.Controllers
_reportLogic.SaveVisitLawyerToExcelFile(new ReportVisitLawyerBindingModel
{
GuarantorId = report.GuarantorId,
FileName = "E:\\reports\\excelVisitLawyerReport.xlsx",
FileName = "D:\\CourseWork\\excelVisitLawyerReport.xlsx",
LawyerId = report.LawyerId
});
}
@ -108,7 +108,7 @@ namespace LawFirmRestApi.Controllers
{
DateFrom = report.DateFrom,
DateTo = report.DateTo,
FileName = "E:\\reports\\pdffile.pdf",
FileName = "D:\\CourseWork\\pdffile.pdf",
GuarantorId = report.GuarantorId,
LawyerId = report.LawyerId,
Email = report.Email,