Compare commits

..

3 Commits

4 changed files with 51 additions and 9 deletions

View File

@ -81,8 +81,11 @@ namespace LawFirmExecutorApp.Controllers
APIClient.PostRequest("api/case/updatecase", new
CaseBindingModel
{
Id = id
ExecutorId = APIClient.Executor.Id,
Name = name,
Status = status,
CaseType = type,
DateCreate = date
});
Response.Redirect("/Home/Cases");
}
@ -94,7 +97,12 @@ namespace LawFirmExecutorApp.Controllers
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
APIClient.PostRequest("api/case/deletecase", );
APIClient.PostRequest("api/case/deletecase", new
CaseBindingModel
{
Id = id,
});
Response.Redirect("/Home/Cases");
}

View File

@ -3,6 +3,7 @@ using LawFirmContracts.ViewModels;
using LawFirmExecutorApp.Models;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using LawFirmContracts.BusinessLogicContracts;
using System.Globalization;
namespace LawFirmExecutorApp.Controllers
@ -10,10 +11,12 @@ namespace LawFirmExecutorApp.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;
}
// СТРАНИЦА ДЕЛ
@ -161,12 +164,14 @@ namespace LawFirmExecutorApp.Controllers
List<ReportClientsViewModel> result;
try
{
string dateFromS = dateFrom.ToString("s", CultureInfo.InvariantCulture);
string dateToS = dateTo.ToString("s", CultureInfo.InvariantCulture);
result = APIClient.GetRequest<List<ReportClientsViewModel>>
($"api/reportexecutor/getconsultationhearingreport?datefrom={dateFromS}&dateto={dateToS}&executorid={APIClient.Executor.Id}")!;
result = _report.GetGetClients(new ReportBindingModel
{
ExecutorId = APIClient.Executor.Id,
DateFrom = dateFrom,
DateTo = dateTo
});
}
}
catch (Exception ex)
{
_logger.LogError(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 LawFirmExecutorApp;
using LawFirmContracts.StoragesContracts;
using LawFirmDatabaseImplement.Implements;
using LawFirmBusinessLogic.BusinessLogics;
using LawFirmBusinessLogic.OfficePackages;
using LawFirmBusinessLogic.MailWorker;
using LawFirmBusinessLogic.OfficePackages.Implements;
var builder = WebApplication.CreateBuilder(args);
//builder.Services.AddTransient<ICaseStorage, CaseStorage>();
//builder.Services.AddTransient<IVisitStorage, VisitStorage>();
//builder.Services.AddTransient<IClientStorage, ClientStorage>();
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();