yes
This commit is contained in:
parent
c8f23dc834
commit
9b303fd0f6
@ -188,19 +188,12 @@ namespace LawFirmBusinessLogic.BusinessLogics
|
||||
public List<ReportConsultationHearingViewModel> GetConsultationHearing(ReportBindingModel model)
|
||||
{
|
||||
var list = new List<ReportConsultationHearingViewModel>();
|
||||
var lawyers = _lawyerStorage.GetFullList();
|
||||
var consultations = _consultationStorage.GetFullList();
|
||||
var visits = _visitStorage.GetFilteredList(new VisitSearchModel
|
||||
{
|
||||
|
||||
DateFrom
|
||||
= model.DateFrom,
|
||||
DateTo = model.DateTo
|
||||
});
|
||||
var lawyers = _lawyerStorage.GetFilteredList(new LawyerSearchModel { CompanyId = model.CompanyId});
|
||||
var consultations = _consultationStorage.GetFilteredList(new ConsultationSearchModel { CompanyId = model.CompanyId });
|
||||
var hearings = _hearingStorage.GetFilteredList(new HearingSearchModel
|
||||
{
|
||||
DateFrom
|
||||
= model.DateFrom,
|
||||
CompanyId = model.CompanyId,
|
||||
DateFrom = model.DateFrom,
|
||||
DateTo = model.DateTo
|
||||
});
|
||||
foreach (LawyerViewModel lawyer in lawyers)
|
||||
@ -215,17 +208,9 @@ namespace LawFirmBusinessLogic.BusinessLogics
|
||||
|
||||
foreach (var consultation in consultations)
|
||||
{
|
||||
if (consultation.ConsultationLawyers.ContainsKey(lawyer.Id)) {
|
||||
|
||||
foreach (var visit in visits)
|
||||
{
|
||||
if (visit.ConsultationId == consultation.Id)
|
||||
{
|
||||
record.Consultation.Add(new(consultation.Id, consultation.Cost));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (consultation.ConsultationLawyers.ContainsKey(lawyer.Id))
|
||||
{
|
||||
record.Consultation.Add(new(consultation.Id, consultation.Cost));
|
||||
}
|
||||
}
|
||||
foreach(var hearing in hearings)
|
||||
@ -234,7 +219,6 @@ namespace LawFirmBusinessLogic.BusinessLogics
|
||||
{
|
||||
record.Hearing.Add(new(hearing.HearingDate, hearing.Court));
|
||||
}
|
||||
|
||||
}
|
||||
list.Add(record);
|
||||
}
|
||||
|
@ -16,18 +16,16 @@ namespace LawFirmBusinessLogic.OfficePackages
|
||||
CreateParagraph(new PdfParagraph
|
||||
{
|
||||
Text = info.Title,
|
||||
Style =
|
||||
"NormalTitle",
|
||||
Style = "NormalTitle",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
CreateParagraph(new PdfParagraph
|
||||
{
|
||||
Text = $"с{info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}",
|
||||
Style
|
||||
= "Normal",
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
CreateTable(new List<string> { "5cm", "3cm", "4cm" });
|
||||
CreateTable(new List<string> { "3cm", "5cm", "5cm" });
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { "Юрист", "Номер консультации", "Цена консультации" },
|
||||
@ -37,23 +35,29 @@ namespace LawFirmBusinessLogic.OfficePackages
|
||||
|
||||
foreach (var ch in info.ConsultationHearing)
|
||||
{
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { ch.LawyerName, " ", " " },
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
|
||||
});
|
||||
foreach (var cons in ch.Consultation)
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { ch.LawyerName, cons.Id.ToString(), cons.Price.ToString()},
|
||||
Texts = new List<string> {" ", cons.Id.ToString(), cons.Price.ToString()},
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
});
|
||||
CreateParagraph(new PdfParagraph
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Text = $"Итого: {ch.Consultation.Count}\t",
|
||||
Texts = new List<string> { " ", " ", "Итого: " + ch.Consultation.Count.ToString() },
|
||||
Style = "Normal",
|
||||
ParagraphAlignment =
|
||||
PdfParagraphAlignmentType.Rigth
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Rigth
|
||||
});
|
||||
}
|
||||
|
||||
CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm" });
|
||||
CreateTable(new List<string> { "3cm", "5cm", "5cm"});
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { "Юрист", "Суд", "Дата слушания" },
|
||||
@ -62,19 +66,25 @@ namespace LawFirmBusinessLogic.OfficePackages
|
||||
});
|
||||
foreach (var ch in info.ConsultationHearing)
|
||||
{
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> {ch.LawyerName, " ", " " },
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||
|
||||
});
|
||||
foreach (var hear in ch.Hearing)
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Texts = new List<string> { ch.LawyerName, hear.Court, hear.HearingDate.ToShortDateString() },
|
||||
Texts = new List<string> { " ", hear.Court, hear.HearingDate.ToShortDateString() },
|
||||
Style = "Normal",
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||
});
|
||||
CreateParagraph(new PdfParagraph
|
||||
CreateRow(new PdfRowParameters
|
||||
{
|
||||
Text = $"Итого: {ch.Hearing.Count}\t",
|
||||
Texts = new List<string> { " ", " ", "Итого: " + ch.Hearing.Count.ToString()},
|
||||
Style = "Normal",
|
||||
ParagraphAlignment =
|
||||
PdfParagraphAlignmentType.Rigth
|
||||
ParagraphAlignment = PdfParagraphAlignmentType.Rigth
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,5 @@ namespace LawFirmClientApp.Controllers
|
||||
return View(APIClient.GetRequest<List<ReportClientsViewModel>>($"api/report/getclientsreport?datefrom={dateFrom}&dateTo={dateTo}&companyId={APIClient.User.CompanyId}"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,21 +12,16 @@ namespace LawFirmContracts.BusinessLogicContracts
|
||||
{
|
||||
|
||||
List<ReportClientsHearingViewModel> GetClientsHearing(ReportBindingModel model);
|
||||
|
||||
List<ReportClientsViewModel> GetGetClients(ReportBindingModel model);
|
||||
|
||||
List<ReportVisitLawyerViewModel> GetVisitLawyer(ReportBindingModel model);
|
||||
List<ReportConsultationHearingViewModel> GetConsultationHearing(ReportBindingModel model);
|
||||
|
||||
|
||||
void SaveClientsHearingToWordFile(ReportBindingModel model);
|
||||
|
||||
void SaveClientsHearingToExcelFile(ReportBindingModel model);
|
||||
|
||||
void SaveVisitLawyerToWordFile(ReportBindingModel model);
|
||||
void SaveVisitLawyerToExcelFile(ReportBindingModel model);
|
||||
void SaveConsultationHearingToPdfFile(ReportBindingModel model);
|
||||
|
||||
void SaveClientsToPdfFile(ReportBindingModel model);
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using LawFirmContracts.BindingModels;
|
||||
using DocumentFormat.OpenXml.InkML;
|
||||
using LawFirmContracts.BindingModels;
|
||||
using LawFirmContracts.SearchModels;
|
||||
using LawFirmContracts.StoragesContracts;
|
||||
using LawFirmContracts.ViewModels;
|
||||
@ -18,7 +19,9 @@ namespace LawFirmDatabaseImplement.Implements
|
||||
{
|
||||
using var context = new LawFirmDatabase();
|
||||
return context.Hearings
|
||||
.ToList()
|
||||
.Include(x => x.Lawyers)
|
||||
.ThenInclude(x => x.Lawyer)
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel)
|
||||
.Select(y => { y.CaseName = context.Cases.FirstOrDefault(x => x.Id == y.CaseId).Name; return y; }).ToList();
|
||||
}
|
||||
@ -29,11 +32,25 @@ namespace LawFirmDatabaseImplement.Implements
|
||||
{
|
||||
return new();
|
||||
}
|
||||
if (model.CompanyId.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue)
|
||||
{
|
||||
using var context = new LawFirmDatabase();
|
||||
return context.Hearings
|
||||
.Include(x => x.Lawyers)
|
||||
.ThenInclude(x => x.Lawyer)
|
||||
.Where(x => x.CompanyId == model.CompanyId && x.HearingDate >= model.DateFrom && x.HearingDate <= model.DateTo)
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel)
|
||||
.Select(y => { y.CaseName = context.Cases.FirstOrDefault(x => x.Id == y.CaseId).Name; return y; })
|
||||
.ToList();
|
||||
}
|
||||
if (model.CompanyId.HasValue)
|
||||
{
|
||||
using var context = new LawFirmDatabase();
|
||||
return context.Hearings
|
||||
.Where(x => x.CompanyId == model.CompanyId)
|
||||
.Include(x => x.Lawyers)
|
||||
.ThenInclude(x => x.Lawyer)
|
||||
.Where(x => x.CompanyId == model.CompanyId)
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel)
|
||||
.Select(y => { y.CaseName = context.Cases.FirstOrDefault(x => x.Id == y.CaseId).Name; return y; })
|
||||
@ -43,6 +60,8 @@ namespace LawFirmDatabaseImplement.Implements
|
||||
{
|
||||
using var context = new LawFirmDatabase();
|
||||
return context.Hearings
|
||||
.Include(x => x.Lawyers)
|
||||
.ThenInclude(x => x.Lawyer)
|
||||
.Where(x => x.Id == model.Id)
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel)
|
||||
@ -53,6 +72,8 @@ namespace LawFirmDatabaseImplement.Implements
|
||||
{
|
||||
using var context = new LawFirmDatabase();
|
||||
return context.Hearings
|
||||
.Include(x => x.Lawyers)
|
||||
.ThenInclude(x => x.Lawyer)
|
||||
.Where(x => x.HearingDate >= model.DateFrom && x.HearingDate <= model.DateTo)
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel).Select(y => { y.CaseName = context.Cases.FirstOrDefault(x => x.Id == y.CaseId).Name; return y; })
|
||||
@ -67,6 +88,8 @@ namespace LawFirmDatabaseImplement.Implements
|
||||
}
|
||||
using var context = new LawFirmDatabase();
|
||||
return AccessHearingStorage(context.Hearings
|
||||
.Include(x => x.Lawyers)
|
||||
.ThenInclude(x => x.Lawyer)
|
||||
.FirstOrDefault(x => (model.Id.HasValue
|
||||
&& x.Id == model.Id) || (model.CompanyId.HasValue
|
||||
&& x.CompanyId == model.CompanyId))
|
||||
@ -104,7 +127,7 @@ namespace LawFirmDatabaseImplement.Implements
|
||||
}
|
||||
catch
|
||||
{
|
||||
transaction.Rollback();
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,16 @@ namespace LawFirmDatabaseImplement.Implements
|
||||
{
|
||||
return new();
|
||||
}
|
||||
if (model.CompanyId.HasValue)
|
||||
if (model.CompanyId.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue)
|
||||
{
|
||||
using var context = new LawFirmDatabase();
|
||||
return context.Visits
|
||||
.Include(x => x.Clients).ThenInclude(x => x.Client)
|
||||
.Where(x => x.CompanyId == model.CompanyId && x.VisitDate >= model.DateFrom && x.VisitDate <= model.DateTo)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
else if (model.CompanyId.HasValue)
|
||||
{
|
||||
using var context = new LawFirmDatabase();
|
||||
return context.Visits
|
||||
|
@ -17,11 +17,11 @@ namespace LawFirmDatabaseImplement
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
|
||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-ON2V3BB\SQLEXPRESS;Initial Catalog=LawFirmDatabase;
|
||||
Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
// optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-ON2V3BB\SQLEXPRESS;Initial Catalog=LawFirmDatabase;
|
||||
//Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
|
||||
/* optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-7A1PHA0\SQLEXPRESS;Initial Catalog=LawFirmDatabase;
|
||||
Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");*/
|
||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-7A1PHA0\SQLEXPRESS;Initial Catalog=LawFirmDatabase;
|
||||
Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
@ -32,9 +32,11 @@ namespace LawFirmDatabaseImplement.Models
|
||||
{
|
||||
if (_hearingLawyers == null)
|
||||
{
|
||||
_hearingLawyers = Lawyers
|
||||
.ToDictionary(recPC => recPC.LawyerId, recPC => recPC.Lawyer as ILawyerModel);
|
||||
}
|
||||
using var context = new LawFirmDatabase();
|
||||
_hearingLawyers = Lawyers
|
||||
.ToDictionary(x => x.LawyerId, x => (context.Lawyers
|
||||
.FirstOrDefault(y => y.Id == x.LawyerId) as ILawyerModel));
|
||||
}
|
||||
return _hearingLawyers;
|
||||
}
|
||||
}
|
||||
@ -109,7 +111,7 @@ namespace LawFirmDatabaseImplement.Models
|
||||
}
|
||||
context.SaveChanges();
|
||||
}
|
||||
_hearingLawyers = null;
|
||||
_hear = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ using LawFirmContracts.ViewModels;
|
||||
using LawFirmManagerApp;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LawFirmClientApp.Controllers
|
||||
namespace LawFirmManagerApp.Controllers
|
||||
{
|
||||
public class ConsultationController : Controller
|
||||
{
|
||||
|
@ -4,7 +4,7 @@ using LawFirmContracts.ViewModels;
|
||||
using LawFirmManagerApp;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LawFirmClientApp.Controllers
|
||||
namespace LawFirmManagerApp.Controllers
|
||||
{
|
||||
public class HearingController : Controller
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using System.Diagnostics;
|
||||
using LawFirmContracts.SearchModels;
|
||||
|
||||
namespace LawFirmClientApp.Controllers
|
||||
namespace LawFirmManagerApp.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ using LawFirmContracts.SearchModels;
|
||||
using LawFirmManagerApp;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LawFirmClientApp.Controllers
|
||||
namespace LawFirmManagerApp.Controllers
|
||||
{
|
||||
public class LawyerController : Controller
|
||||
{
|
||||
|
@ -1,40 +1,47 @@
|
||||
using LawFirmContracts.BindingModels;
|
||||
using LawFirmContracts.BusinessLogicContracts;
|
||||
using LawFirmContracts.ViewModels;
|
||||
using LawFirmManagerApp;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LawFirmClientApp.Controllers
|
||||
namespace LawFirmManagerApp.Controllers
|
||||
{
|
||||
public class ReportController : Controller
|
||||
{
|
||||
|
||||
/*[HttpGet]
|
||||
public void CreateReportClients(DateTime dateFrom, DateTime dateTo)
|
||||
[HttpPost]
|
||||
public void LoadReportConsultHear(DateTime dateFrom, DateTime dateTo)
|
||||
{
|
||||
if (APIClient.User == null)
|
||||
{
|
||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
||||
Redirect("~/Home/Enter");
|
||||
}
|
||||
|
||||
APIClient.GetRequest<List<ReportClientsViewModel>>($"api/report/getclientsreport", new ReportBindingModel
|
||||
APIClient.PostRequest($"api/report/saveconsultationhearingtopdffile", new ReportBindingModel
|
||||
{
|
||||
DateFrom = dateFrom,
|
||||
DateTo = dateTo
|
||||
|
||||
|
||||
|
||||
Response.Redirect("CreateReportClients");
|
||||
}*/
|
||||
DateTo = dateTo,
|
||||
CompanyId = APIClient.User.CompanyId
|
||||
});
|
||||
}
|
||||
[HttpGet]
|
||||
|
||||
public IActionResult CreateReportClients(DateTime dateFrom, DateTime dateTo)
|
||||
public IActionResult LoadReportConsultHear(DateTime dateFrom, DateTime dateTo, string a)
|
||||
{
|
||||
if (APIClient.User == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
|
||||
return View(APIClient.GetRequest<List<ReportClientsViewModel>>($"api/report/getclientsreport?datefrom={dateFrom}&dateTo={dateTo}&companyId={APIClient.User.CompanyId}"));
|
||||
return View(APIClient.GetRequest<List<ReportConsultationHearingViewModel>>($"api/report/getconsultationhearing?datefrom={dateFrom}&dateTo={dateTo}&companyId={APIClient.User.CompanyId}"));
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult CreateReportConsultHear(DateTime dateFrom, DateTime dateTo)
|
||||
{
|
||||
if (APIClient.User == null)
|
||||
{
|
||||
return Redirect("~/Home/EnterManager");
|
||||
}
|
||||
|
||||
return View(APIClient.GetRequest<List<ReportConsultationHearingViewModel>>($"api/report/getconsultationhearing?datefrom={dateFrom}&dateTo={dateTo}&companyId={APIClient.User.CompanyId}"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,9 +3,6 @@ using LawFirmDatabaseImplement.Implements;
|
||||
using LawFirmManagerApp;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddTransient<ICaseStorage, CaseStorage>();
|
||||
builder.Services.AddTransient<IVisitStorage, VisitStorage>();
|
||||
builder.Services.AddTransient<IClientStorage, ClientStorage>();
|
||||
|
||||
|
||||
// Add services to the container.
|
||||
|
@ -0,0 +1,175 @@
|
||||
@using LawFirmContracts.ViewModels;
|
||||
|
||||
@model List<ReportConsultationHearingViewModel>
|
||||
@{
|
||||
ViewData["Title"] = "Отчёт";
|
||||
Layout = "~/Views/Shared/_LayoutManager.cshtml";
|
||||
}
|
||||
<head>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
</head>
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Отчёт по слушаниям и консультациям</h1>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
@{
|
||||
<form action="/Report/CreateReportConsultHear" method="get">
|
||||
|
||||
<button type="submit" class="btn btn-danger" id="formload">Получить отчет</button>
|
||||
<button type="submit" class="btn btn-danger" id="loadButton">Скачать отчёт</button>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4">От</div>
|
||||
|
||||
<input type="datetime" placeholder="От" name="dateFrom" id="dateFrom">
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">До</div>
|
||||
|
||||
<input type="datetime" placeholder="До" name="dateTo" id="dateTo">
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Юрист
|
||||
</th>
|
||||
<th>
|
||||
Номер консультации
|
||||
</th>
|
||||
<th>
|
||||
Цена консультации
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.LawyerName</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@foreach (var cons in item.Consultation)
|
||||
{
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
@cons.Id
|
||||
</td>
|
||||
<td>
|
||||
@cons.Price
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>Итого: @item.Consultation.Count</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Юрист
|
||||
</th>
|
||||
<th>
|
||||
Суд
|
||||
</th>
|
||||
<th>
|
||||
Дата Слушания
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.LawyerName</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@foreach (var hear in item.Hearing)
|
||||
{
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => hear.Court)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => hear.HearingDate)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>Итого: @item.Hearing.Count</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#formDownload').submit(function (e) {
|
||||
e.preventDefault(); // Предотвращаем отправку формы по умолчанию
|
||||
|
||||
var dateto = $('#dateTo').val(); // Получаем значение поля dateto
|
||||
var datefrom = $('#dateFrom').val(); // Получаем значение поля datefrom
|
||||
|
||||
// Выполняем AJAX-запрос
|
||||
$.ajax({
|
||||
url: '/Report/CreateReportConsultHear', // Замените на URL вашего обработчика формы
|
||||
type: 'POST', // Или 'GET', в зависимости от типа запроса
|
||||
data: {
|
||||
dateto: dateto,
|
||||
datefrom: datefrom
|
||||
},
|
||||
success: function (response) {
|
||||
// Обработка успешного ответа
|
||||
console.log(response);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
// Обработка ошибки
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#loadButton').click(function () {
|
||||
var dateTo = $('#dateTo').val();
|
||||
var dateFrom = $('#dateFrom').val();
|
||||
// Выполняем AJAX-запрос
|
||||
$.ajax({
|
||||
url: '/Report/LoadReportConsultHear', // Замените на URL вашего метода контроллера
|
||||
type: 'POST', // Или 'POST', в зависимости от типа запроса
|
||||
data: {
|
||||
dateTo: dateTo,
|
||||
dateFrom: dateFrom
|
||||
},
|
||||
success: function (response) {
|
||||
// Обработка успешного ответа
|
||||
console.log(response);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
// Обработка ошибки
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
@ -31,7 +31,9 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Lawyers">Юристы</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Report" asp-action="CreateReportConsultHear">Отчёт</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="PrivacyManager">Личные данные</a>
|
||||
</li>
|
||||
|
@ -41,6 +41,27 @@ namespace LawFirmRestApi.Controllers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
[HttpPost]
|
||||
public void SaveConsultationHearingToPdfFile(ReportBindingModel report)
|
||||
{
|
||||
try
|
||||
{
|
||||
_reportLogic.SaveConsultationHearingToPdfFile(new ReportBindingModel
|
||||
{
|
||||
DateFrom = report.DateFrom,
|
||||
DateTo = report.DateTo,
|
||||
FileName = "C:\\Users\\xarla\\OneDrive\\Документы\\Отчёты_по_юрфирме\\pdfreport.pdf",
|
||||
LawyerId = report.LawyerId,
|
||||
CompanyId = report.CompanyId,
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка создания отчета");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public List<ReportClientsViewModel> GetClientsReport(DateTime dateFrom, DateTime dateTo, int companyId)
|
||||
{
|
||||
@ -54,6 +75,19 @@ namespace LawFirmRestApi.Controllers
|
||||
throw;
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public List<ReportConsultationHearingViewModel> GetConsultationHearing(DateTime dateFrom, DateTime dateTo, int companyId)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _reportLogic.GetConsultationHearing(new ReportBindingModel { DateFrom = dateFrom, DateTo = dateTo, CompanyId = companyId });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка создания отчета");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user