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

View File

@ -3,6 +3,7 @@ using LawFirmContracts.ViewModels;
using LawFirmExecutorApp.Models; using LawFirmExecutorApp.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Diagnostics; using System.Diagnostics;
using LawFirmContracts.BusinessLogicContracts;
using System.Globalization; using System.Globalization;
namespace LawFirmExecutorApp.Controllers namespace LawFirmExecutorApp.Controllers
@ -10,10 +11,12 @@ namespace LawFirmExecutorApp.Controllers
public class HomeController : Controller public class HomeController : Controller
{ {
private readonly ILogger<HomeController> _logger; private readonly ILogger<HomeController> _logger;
private readonly IReportLogic _report;
public HomeController(ILogger<HomeController> logger) public HomeController(ILogger<HomeController> logger, IReportLogic report)
{ {
_logger = logger; _logger = logger;
_report = report;
} }
// СТРАНИЦА ДЕЛ // СТРАНИЦА ДЕЛ
@ -161,12 +164,14 @@ namespace LawFirmExecutorApp.Controllers
List<ReportClientsViewModel> result; List<ReportClientsViewModel> result;
try try
{ {
string dateFromS = dateFrom.ToString("s", CultureInfo.InvariantCulture); result = _report.GetGetClients(new ReportBindingModel
string dateToS = dateTo.ToString("s", CultureInfo.InvariantCulture); {
result = APIClient.GetRequest<List<ReportClientsViewModel>> ExecutorId = APIClient.Executor.Id,
($"api/reportexecutor/getconsultationhearingreport?datefrom={dateFromS}&dateto={dateToS}&executorid={APIClient.Executor.Id}")!; DateFrom = dateFrom,
DateTo = dateTo
});
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Ошибка создания отчета"); _logger.LogError(ex, "Ошибка создания отчета");

View File

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

View File

@ -1,11 +1,38 @@
using LawFirmContracts.BusinessLogicContracts;
using LawFirmExecutorApp; using LawFirmExecutorApp;
using LawFirmContracts.StoragesContracts; using LawFirmContracts.StoragesContracts;
using LawFirmDatabaseImplement.Implements; using LawFirmDatabaseImplement.Implements;
using LawFirmBusinessLogic.BusinessLogics;
using LawFirmBusinessLogic.OfficePackages;
using LawFirmBusinessLogic.MailWorker;
using LawFirmBusinessLogic.OfficePackages.Implements;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
//builder.Services.AddTransient<ICaseStorage, CaseStorage>(); //builder.Services.AddTransient<ICaseStorage, CaseStorage>();
//builder.Services.AddTransient<IVisitStorage, VisitStorage>(); //builder.Services.AddTransient<IVisitStorage, VisitStorage>();
//builder.Services.AddTransient<IClientStorage, ClientStorage>(); //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. // Add services to the container.
builder.Services.AddControllersWithViews(); builder.Services.AddControllersWithViews();