Веб для Исполнителя

This commit is contained in:
Софья Якобчук 2024-05-27 02:45:38 +04:00
parent 1724d0f4cf
commit 8c84e64cb2
25 changed files with 942 additions and 175 deletions

View File

@ -1,12 +1,115 @@
using Microsoft.AspNetCore.Mvc;
using LawCompanyContracts.BindingModels;
using LawCompanyContracts.SearchModels;
using LawCompanyContracts.ViewModels;
using LawCompanyDataModels.Enums;
using LawCompanyDataModels.Models;
using Microsoft.AspNetCore.Mvc;
namespace LawCompanyExecutorApp.Controllers
{
public class CaseController : Controller
{
public IActionResult Index()
{
return View();
}
}
public class CaseController : Controller
{
[HttpGet]
public IActionResult CreateCase()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
ViewBag.Clients = APIClient.GetRequest<List<ClientViewModel>>($"api/client/GetClientList?executorId={APIClient.Executor.Id}");
return View();
}
[HttpPost]
public void CreateCase(string name, List<int> clientselect)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
Dictionary<int, IClientModel> client = new Dictionary<int, IClientModel>();
foreach (int members in clientselect)
{
client.Add(members, new ClientSearchModel { Id = members } as IClientModel);
}
APIClient.PostRequest("api/case/createcase", new CaseBindingModel
{
Name = name,
DateCreate = DateTime.Now,
CaseClients = client,
ExecutorId = APIClient.Executor.Id,
});
Response.Redirect("/Home/Cases");
}
[HttpPost]
public void DeleteCase(int id)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
APIClient.PostRequest("api/case/deletecase", new CaseBindingModel
{
Id = id
});
Response.Redirect("/Home/Cases");
}
[HttpGet]
public IActionResult UpdateCase(int id)
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
var caseViewModel = APIClient.GetRequest<CaseViewModel>($"api/case/GetCase/{id}");
if (caseViewModel == null)
{
return NotFound();
}
ViewBag.Clients = APIClient.GetRequest<List<ClientViewModel>>($"api/client/GetClientList?executorId={APIClient.Executor.Id}");
return View(caseViewModel);
}
[HttpPost]
public void UpdateCase(int id, string name, int statusId, List<int> clientselect)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
Dictionary<int, IClientModel> client = new Dictionary<int, IClientModel>();
foreach (int members in clientselect)
{
client.Add(members, new ClientSearchModel { Id = members } as IClientModel);
}
APIClient.PostRequest("api/case/updatecase", new CaseBindingModel
{
Id = id,
Name = name,
Status = (CaseStatus)statusId,
CaseClients = client
});
Response.Redirect("/Home/Cases");
}
[HttpGet]
public IActionResult CaseClients(int id)
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.GetRequest<List<ClientViewModel>>($"api/case/getclientlisttocase?caseId={id}"));
}
}
}

View File

@ -1,12 +1,86 @@
using Microsoft.AspNetCore.Mvc;
using DocumentFormat.OpenXml.Office2010.Excel;
using LawCompanyContracts.BindingModels;
using LawCompanyContracts.SearchModels;
using LawCompanyContracts.ViewModels;
using LawCompanyDatabaseImplement.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace LawCompanyExecutorApp.Controllers
{
public class ClientController : Controller
{
public IActionResult Index()
[HttpGet]
public IActionResult CreateClient()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View();
}
[HttpPost]
public void CreateClient(string fio, string phone, string email)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
APIClient.PostRequest("api/client/createclient", new ClientBindingModel
{
FIO = fio,
Phone = phone,
Email = email,
ExecutorId = APIClient.Executor.Id,
});
Response.Redirect("/Home/Clients");
}
[HttpPost]
public void DeleteClient(int id)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
APIClient.PostRequest("api/client/deleteclient", new ClientBindingModel
{
Id = id
});
Response.Redirect("/Home/Clients");
}
[HttpGet]
public IActionResult UpdateClient(int id)
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
var client = APIClient.GetRequest<ClientViewModel>($"api/client/getclientbyid/{id}");
return View(client);
}
[HttpPost]
public void UpdateClient(int id, string fio, string email, string phone)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
APIClient.PostRequest("api/client/updateclient", new ClientBindingModel
{
Id = id,
FIO = fio,
Email = email,
Phone = phone
});
Response.Redirect("/Home/Clients");
}
}
}
}

View File

@ -1,4 +1,7 @@
using LawCompanyExecutorApp.Models;
using LawCompanyContracts.BindingModels;
using LawCompanyContracts.BusinessLogicContracts;
using LawCompanyContracts.ViewModels;
using LawCompanyExecutorApp.Models;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
@ -7,20 +10,325 @@ namespace LawCompanyExecutorApp.Controllers
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly IReportExecutorLogic _report;
public HomeController(ILogger<HomeController> logger)
public HomeController(ILogger<HomeController> logger, IReportExecutorLogic report)
{
_logger = logger;
_report = report;
}
public IActionResult Index()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View();
}
public IActionResult Register()
{
return View();
}
[HttpPost]
public void Register(string fio, string email, string password)
{
if (string.IsNullOrEmpty(fio) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password))
{
throw new Exception("Введите фио, почту и пароль");
}
APIClient.PostRequest("api/executor/register", new ExecutorBindingModel
{
FIO = fio,
Email = email,
Password = password,
});
Response.Redirect("Enter");
return;
}
public IActionResult Enter()
{
return View();
}
[HttpPost]
public void Enter(string login, string password)
{
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
{
throw new Exception("Введите логин и пароль");
}
APIClient.Executor = APIClient.GetRequest<ExecutorViewModel>($"api/executor/login?login={login}&password={password}");
if (APIClient.Executor == null)
{
throw new Exception("Неверный логин/пароль");
}
Response.Redirect("Index");
}
public IActionResult Privacy()
{
return View();
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.Executor);
}
[HttpPost]
public void Privacy(string fio, string email, string password)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как сюда попали? Сюда вход только авторизованным");
}
if (string.IsNullOrEmpty(fio) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password))
{
throw new Exception("Введите фио, почту и пароль");
}
APIClient.PostRequest("api/executor/updatedata", new ExecutorBindingModel
{
Id = APIClient.Executor.Id,
FIO = fio,
Password = password,
Email = email,
});
APIClient.Executor.FIO = fio;
APIClient.Executor.Email = email;
APIClient.Executor.Password = password;
Response.Redirect("Index");
}
public IActionResult Clients()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.GetRequest<List<ClientViewModel>>($"api/client/getclientlist?executorId={APIClient.Executor.Id}"));
}
public IActionResult Cases()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.GetRequest<List<CaseViewModel>>($"api/case/GetCaseList?executorId={APIClient.Executor.Id}"));
}
public IActionResult Visits()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.GetRequest<List<VisitViewModel>>($"api/visit/getvisitlist?executorId={APIClient.Executor.Id}"));
}
public IActionResult VisitHearing()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
ViewBag.Visits = APIClient.GetRequest<List<VisitViewModel>>($"api/visit/GetVisitList?executorId={APIClient.Executor.Id}");
ViewBag.Hearings = APIClient.GetRequest<List<HearingViewModel>>($"api/hearing/GetHearingList");
return View();
}
[HttpPost]
public void VisitHearing(int visit, int hearing)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как сюда попали? Сюда вход только авторизованным");
}
var roomElem = APIClient.GetRequest<VisitViewModel>($"api/visit/GetVisit?id={visit}");
APIClient.PostRequest("api/visit/updatevisit", new VisitBindingModel
{
Id = visit,
ExecutorId = APIClient.Executor.Id,
VisitDate = roomElem.VisitDate,
HearingId = hearing
});
Response.Redirect("Visits");
}
[HttpGet]
public IActionResult ClientHearingToFile()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.GetRequest<List<ClientViewModel>>($"api/client/GetClientList?executorId={APIClient.Executor.Id}"));
}
[HttpPost]
public void ClientHearingToFile(int[] Ids, string type)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
if (Ids.Length <= 0)
{
throw new Exception("Количество должно быть больше 0");
}
if (string.IsNullOrEmpty(type))
{
throw new Exception("Неверный тип отчета");
}
List<int> res = new List<int>();
foreach (var item in Ids)
{
res.Add(item);
}
if (type == "docx")
{
APIClient.PostRequest("api/report/CreateExecutorReportToWordFile", new ReportExecutorBindingModel
{
Ids = res,
FileName = "C:\\Reports\\wordfile.docx"
});
Response.Redirect("GetWordFile");
}
else
{
APIClient.PostRequest("api/report/CreateOrganiserReportToExcelFile", new ReportExecutorBindingModel
{
Ids = res,
FileName = "C:\\Reports\\excelfile.xlsx"
});
Response.Redirect("GetExcelFile");
}
}
[HttpGet]
public IActionResult GetWordFile()
{
return new PhysicalFileResult("C:\\Reports\\wordfile.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
}
[HttpGet]
public IActionResult GetExcelFile()
{
return new PhysicalFileResult("C:\\Reports\\excelfile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
}
public IActionResult GetPdfFile()
{
return new PhysicalFileResult("C:\\ReportsCourseWork\\pdffile.pdf", "application/pdf");
}
[HttpGet]
public IActionResult ClientsToPdfFile()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View("ClientsToPdfFile");
}
[HttpPost]
public void ClientsToPdfFile(DateTime dateFrom, DateTime dateTo, string email)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
if (string.IsNullOrEmpty(email))
{
throw new Exception("Email пуст");
}
APIClient.PostRequest("api/report/CreateExecutorReportToPdfFile", new ReportExecutorBindingModel
{
DateFrom = dateFrom,
DateTo = dateTo,
ExecutorId = APIClient.Executor.Id
});
APIClient.PostRequest("api/report/SendPdfToMail", new MailSendInfoBindingModel
{
MailAddress = email,
Subject = "Отчет по клиентам (pdf)",
Text = "Отчет по клиентам с " + dateFrom.ToShortDateString() + " до " + dateTo.ToShortDateString()
});
Response.Redirect("ClientsToPdfFile");
}
[HttpGet]
public string GetClientsReport(DateTime dateFrom, DateTime dateTo)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
List<ReportClientsViewModel> result;
try
{
result = _report.GetClients(new ReportExecutorBindingModel
{
ExecutorId = APIClient.Executor.Id,
DateFrom = dateFrom,
DateTo = dateTo
});
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка создания отчета");
throw;
}
double sum = 0;
string table = "";
table += "<h2 class=\"text-custom-color-1\">Предварительный отчет</h2>";
table += "<div class=\"table-responsive\">";
table += "<table class=\"table table-striped table-bordered table-hover\">";
table += "<thead class=\"table-dark\">";
table += "<tr>";
table += "<th scope=\"col\">Клиент</th>";
table += "<th scope=\"col\">Наименование дела</th>";
table += "<th scope=\"col\">Статус дела</th>";
table += "<th scope=\"col\">Дата консультации</th>";
table += "<th scope=\"col\">Цена консультации</th>";
table += "</tr>";
table += "</thead>";
foreach (var report in result)
{
bool IsCost = true;
if (report.Cost == 0)
{
IsCost = false;
}
table += "<tbody>";
table += "<tr>";
table += $"<td>{report.FIO}</td>";
table += $"<td>{report.Name}</td>";
table += $"<td>{report.Status}</td>";
table += $"<td>{report.ConsultationDate.ToShortDateString()}</td>";
table += $"<td>{(IsCost ? report.Cost.ToString() : string.Empty)}</td>";
table += "</tr>";
table += "</tbody>";
sum += report.Cost;
}
table += "<tfoot class=\"table-secondary\">";
table += $"<tr><th colspan=\"2\">Итого:</th><th>{sum}</th><th colspan=\"2\"></th></tr>";
table += "</tfoot>";
table += "</table>";
table += "</div>";
return table;
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]

View File

@ -0,0 +1,114 @@
using LawCompanyContracts.BindingModels;
using LawCompanyContracts.SearchModels;
using LawCompanyContracts.ViewModels;
using LawCompanyDataModels.Models;
using Microsoft.AspNetCore.Mvc;
namespace LawCompanyExecutorApp.Controllers
{
public class VisitController : Controller
{
[HttpGet]
public IActionResult CreateVisit()
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
ViewBag.Clients = APIClient.GetRequest<List<ClientViewModel>>($"api/client/GetClientList?executorId={APIClient.Executor.Id}");
return View();
}
[HttpPost]
public void CreateVisit(DateTime visitDate, List<int> clientselect)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
if (string.IsNullOrEmpty(visitDate.ToString()))
{
throw new Exception("Введите дату");
}
Dictionary<int, IClientModel> client = new Dictionary<int, IClientModel>();
foreach (int members in clientselect)
{
client.Add(members, new ClientSearchModel { Id = members } as IClientModel);
}
APIClient.PostRequest("api/visit/createvisit", new VisitBindingModel
{
VisitDate = visitDate,
ExecutorId = APIClient.Executor.Id,
VisitClients = client
});
Response.Redirect("/Home/Visits");
}
[HttpPost]
public void DeleteVisit(int id)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
APIClient.PostRequest("api/visit/deletevisit", new VisitBindingModel
{
Id = id
});
Response.Redirect("/Home/Visits");
}
[HttpGet]
public IActionResult UpdateVisit(int id)
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
ViewBag.Clients = APIClient.GetRequest<List<ClientViewModel>>($"api/client/GetClientList?executorId={APIClient.Executor.Id}");
return View();
}
[HttpPost]
public void UpdateVisit(int id, DateTime visitDate, List<int> clientselect)
{
if (APIClient.Executor == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
if (string.IsNullOrEmpty(visitDate.ToString()))
{
throw new Exception("Введите дату");
}
Dictionary<int, IClientModel> client = new Dictionary<int, IClientModel>();
foreach (int members in clientselect)
{
client.Add(members, new ClientSearchModel { Id = members } as IClientModel);
}
APIClient.PostRequest("api/visit/updatevisit", new VisitBindingModel
{
Id = id,
VisitDate = visitDate,
VisitClients = client
});
Response.Redirect("/Home/Visits");
}
[HttpGet]
public IActionResult VisitClients(int id)
{
if (APIClient.Executor == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.GetRequest<List<ClientViewModel>>($"api/visit/getclientlisttovisit?visitId={id}"));
}
}
}

View File

@ -6,13 +6,19 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Controllers\VizitController.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LawCompanyBusinessLogic\LawCompanyBusinessLogic.csproj" />
<ProjectReference Include="..\LawCompanyContracts\LawCompanyContracts.csproj" />
<ProjectReference Include="..\LawCompanyDatabaseImplement\LawCompanyDatabaseImplement.csproj" />
<ProjectReference Include="..\LawCompanyDataModels\LawCompanyDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -4,12 +4,25 @@ using LawCompanyContracts.StoragesContracts;
using LawCompanyContracts.ViewModels;
using LawCompanyDatabaseImplement.Implements;
using LawCompanyDataModels.Models;
using LawCompanyBusinessLogic.OfficePackage;
using LawCompanyBusinessLogic.OfficePackage.Implements;
using LawCompanyContracts.BusinessLogicContracts;
using HotelBusinessLogic.BusinessLogics;
using LawCompanyBusinessLogic.BusinessLogics;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTransient<IReportExecutorLogic, ReportLogicExecutor>();
builder.Services.AddTransient<IReportGuarantorLogic, ReportLogicGuarantor>();
builder.Services.AddTransient<ICaseStorage, CaseStorage>();
builder.Services.AddTransient<IVisitStorage, VisitStorage>();
builder.Services.AddTransient<IClientStorage, ClientStorage>();
builder.Services.AddTransient<IHearingStorage, HearingStorage>();
builder.Services.AddTransient<ILawyerStorage, LawyerStorage>();
builder.Services.AddTransient<IConsultationStorage, ConsultationStorage>();
builder.Services.AddTransient<AbstractSaveToWordExecutor, SaveToWordExecutor>();
builder.Services.AddTransient<AbstractSaveToExcelExecutor, SaveToExcelExecutor>();
builder.Services.AddTransient<AbstractSaveToPdfExecutor, SaveToPdfExecutor>();
// Add services to the container.
builder.Services.AddControllersWithViews();
@ -17,12 +30,10 @@ var app = builder.Build();
APIClient.Connect(builder.Configuration);
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
app.UseHttpsRedirection();
app.UseStaticFiles();

View File

@ -3,7 +3,6 @@
@model List<ClientViewModel>
@{
ViewData["Title"] = "Клиенты";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
<h1 class="display-4">Мои клиенты</h1>

View File

@ -1,6 +1,8 @@
@{
@using LawCompanyContracts.ViewModels;
@using LawCompanyDataModels.Models;
@{
ViewData["Title"] = "CreateCase";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
@ -13,10 +15,17 @@
<input type="text" name="name" id="name" />
</div>
</div>
<div class="form-group">
<div class="col-8">
<select name="clientselect" class="form-control" multiple size="6" id="clientselect">
@foreach (var member in ViewBag.Clients)
{
<option value="@member.Id">@member.FIO</option>
}
</select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Создать" class="btn btn-primary" />
</div>
</form>

View File

@ -1,16 +1,29 @@
@{
@using LawCompanyContracts.ViewModels;
@using LawCompanyDataModels.Models;
@{
ViewData["Title"] = "Обновить дело";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
<h2 class="display-4">Обновление дела</h2>
</div>
<form method="post">
<form asp-action="UpdateCase" method="post">
<input type="hidden" name="id" value="@Model.Id" />
<div class="row">
<div class="col-4">Имя</div>
<div class="col-8">
<input type="text" name="name" id="name" />
<input type="text" name="name" id="name" value="@Model.Name" />
</div>
</div>
<div class="form-group">
<div class="col-8">
<select name="clientselect" class="form-control" multiple size="6" id="clientselect">
@foreach (var member in ViewBag.Clients)
{
<option value="@member.Id">@member.FIO</option>
}
</select>
</div>
</div>
<div class="row">
@ -18,10 +31,13 @@
<div class="col-8">
<select id="statusId" name="statusId" class="form-control">
<option value="0">Принято</option>
<option value="1">АнализДелаИПодготовкаДокументов</option>
<option value="1">Анализ дела и подготовка документов</option>
<option value="2">СлушанияДела</option>
<option value="3">ЗакрытиеДела</option>
</select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Создать" class="btn btn-primary" />
</div>
</form>

View File

@ -16,7 +16,7 @@
<div class="row">
<div class="col-4">Номер телефона</div>
<div class="col-8">
<input type="number" id="phone" name="phone" />
<input type="text" id="phone" name="phone" />
</div>
</div>
<div class="row">

View File

@ -1,34 +1,37 @@
@{
ViewData["Title"] = "Обновить клиента";
Layout = "~/Views/Shared/_Layout.cshtml";
@using LawCompanyContracts.ViewModels
@model ClientViewModel
@{
ViewData["Title"] = "Обновить клиента";
}
<div class="text-center">
<h2 class="display-4">Создание клиента</h2>
<h2 class="display-4">Изменение клиента</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">ФИО</div>
<div class="col-8">
<input type="text" name="fio" id="fio" />
</div>
</div>
<div class="row">
<div class="col-4">Номер телефона</div>
<div class="col-8">
<input type="number" id="phone" name="phone" />
</div>
</div>
<div class="row">
<div class="col-4">E-mail</div>
<div class="col-8">
<input type="text" name="email" id="email" />
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Обновить" class="btn btn-primary" />
</div>
</div>
</form>
<form asp-action="UpdateClient" method="post">
<input type="hidden" name="id" value="@Model.Id" />
<div class="row">
<div class="col-4">ФИО</div>
<div class="col-8">
<input type="text" name="fio" id="fio" value="@Model.FIO" />
</div>
</div>
<div class="row">
<div class="col-4">Номер телефона</div>
<div class="col-8">
<input type="text" id="phone" name="phone" value="@Model.Phone" />
</div>
</div>
<div class="row">
<div class="col-4">E-mail</div>
<div class="col-8">
<input type="text" name="email" id="email" value="@Model.Email" />
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Обновить" class="btn btn-primary" />
</div>
</div>
</form>

View File

@ -10,14 +10,8 @@
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a asp-controller="Case" asp-action="CreateCase">Добавить дела</a>
<a asp-controller="Case" asp-action="AddClient">Добавить клиентов к делам</a>
</p>
<br />
<table class="table">
@ -72,7 +66,7 @@
<td>
<form action="/Case/UpdateCase">
<input type="hidden" name="id" value="@item.Id" />
<button type="submit" class="btn btn-danger">Изменить имя</button>
<button type="submit" class="btn btn-danger">Изменить</button>
</form>
</td>
<td>

View File

@ -0,0 +1,73 @@
@using LawCompanyContracts.ViewModels
@model List<ClientViewModel>
@{
ViewData["Title"] = "ClientHearingToFile";
}
<div class="text-center">
<div class="title">
<h2>Создание отчёта по клиентам</h2>
</div>
</div>
<div class="text-center">
<form method="post">
<div class="file-format">
<label class="form-label">Выберите формат файла:</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="type" value="docx" id="docx">
<label class="form-check-label" for="docx">Word-файл</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="type" value="xlsx" id="xlsx" checked>
<label class="form-check-label" for="xlsx">Excel-файл</label>
</div>
</div>
<div class="table">
<table class="table table-hover">
<thead class="thead-light">
<tr>
<th scope="col"></th>
<th scope="col">ФИО</th>
<th scope="col">Почта</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="Ids[]" value="@item.Id" id="@item.Id">
</div>
</td>
<td>@Html.DisplayFor(modelItem => item.FIO)</td>
<td>@Html.DisplayFor(modelItem => item.Email)</td>
</tr>
}
</tbody>
</table>
</div>
<br>
<div class="d-flex justify-content-center">
<button type="submit" class="btn btn-block btn-outline-dark w-100">Создать</button>
</div>
</form>
</div>
<style>
.title {
margin-top: 10px;
margin-bottom: 30px;
}
.file-format {
margin-bottom: 30px;
}
.table {
margin-bottom: 30px;
}
</style>

View File

@ -3,18 +3,12 @@
@model List<ClientViewModel>
@{
ViewData["Title"] = "Clients";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
<h1 class="display-4">Мои клиенты</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a asp-controller="Client" asp-action="CreateClient">Добавить клиента</a>
</p>

View File

@ -0,0 +1,72 @@
@using LawCompanyContracts.ViewModels
@{
ViewData["Title"] = "ClientsToPdfFile";
}
<div class="container">
<div class="text-center mb-4">
<h2 class="text-custom-color-1">Отчет по клиентам за период</h2>
</div>
<form method="post">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="dateFrom" class="form-label text-custom-color-1">Начало периода:</label>
<input type="datetime-local" id="dateFrom" name="dateFrom" class="form-control" placeholder="Выберите дату начала периода">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="dateTo" class="form-label text-custom-color-1">Окончание периода:</label>
<input type="datetime-local" id="dateTo" name="dateTo" class="form-control" placeholder="Выберите дату окончания периода">
</div>
</div>
</div>
<div class="form-group mb-4">
<label for="email" class="form-label text-custom-color-1">Почта:</label>
<input type="email" id="email" name="email" class="form-control" placeholder="Введите вашу почту">
</div>
<div class="row mb-4">
<div class="col-md-8"></div>
<div class="col-md-4">
<button type="submit" class="btn btn-outline-dark w-100 text-center d-flex justify-content-md-center">Отправить на почту</button>
</div>
</div>
<div class="row mb-4">
<div class="col-md-8"></div>
<div class="col-md-4">
<button type="button" id="demonstrate" class="btn btn-outline-dark w-100 text-center d-flex justify-content-md-center">Продемонстрировать</button>
</div>
</div>
<div id="report"></div>
</form>
</div>
@section Scripts {
<script>
function check() {
var dateFrom = $('#dateFrom').val();
var dateTo = $('#dateTo').val();
if (dateFrom && dateTo) {
$.ajax({
method: "GET",
url: "/Home/GetClientsReport",
data: { dateFrom: dateFrom, dateTo: dateTo },
success: function (result) {
if (result != null) {
$('#report').html(result);
}
}
});
};
}
check();
$('#demonstrate').on('click', (e) => check());
</script>
}

View File

@ -1,6 +1,5 @@
@{
ViewData["Title"] = "Enter";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
<h2 class="display-4">Вход в приложение</h2>

View File

@ -1,62 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - LawCompanyExecutorApp</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bgwhite border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" aspaction="Index">Юридическая фирма "Вас обманут"</a>
<button class="navbar-toggler" type="button" datatoggle="collapse" data-target=".navbar-collapse" ariacontrols="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-smrow-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Cases">Мои дела</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Clients">Клиенты</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Visits">Визиты</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Отчёты по слшуаниям</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Отчёты по клиентам</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Register">Регистрация</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2024 - Юридическая фирма - <a asp-area="" aspcontroller="Home" asp-action="Privacy">Личные данные</a>
</div>
</footer>
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
</html>
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<div class="card">
<div class="card-body">
<h1 class="card-title">LawCompany</h1>
<h4>Курсовая работа</h4>
</div>
</div>
</div>

View File

@ -2,7 +2,6 @@
@model ExecutorViewModel
@{
ViewData["Title"] = "Privacy Policy";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
<h2 class="display-4">Личные данные</h2>

View File

@ -1,6 +1,5 @@
@{
ViewData["Title"] = "Register";
Layout = "/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
<h2 class="display-4">Регистрация исполнителя</h2>
@ -12,7 +11,7 @@
</div>
<div class="row">
<div class="col-4">Логин:</div>
<div class="col-8"><input type="text" name="login" /></div>
<div class="col-8"><input type="text" name="email" /></div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>

View File

@ -0,0 +1,22 @@
@using LawCompanyContracts.ViewModels;
@{
ViewData["Title"] = "VisitHearing";
}
<div class="text-center">
<h2 class="display-4">Связывание визита и слушания</h2>
</div>
<form method="post">
<div class="form-group">
<label for="visit">Визит</label>
<select id="visit" name="visit" class="form-control" asp-items="@(new SelectList(@ViewBag.Visits, "Id", "VisitDate"))"></select>
</div>
<div class="form-group">
<label for="hearing">Слушание</label>
<select id="hearing" name="hearing" class="form-control" asp-items="@(new SelectList(@ViewBag.Hearings, "Id", "HearingDate"))"></select>
</div>
<div class="u-container-layout u-container-layout-2">
<input type="submit" value="Сохранить" class="btn btn-primary" />
</div>
</form>

View File

@ -19,11 +19,6 @@
<a asp-controller="Visit" asp-action="CreateVisit">Добавить визиты</a>
</p>
<br />
<p>
<a asp-controller="Visit" asp-action="AddClient">Назначить клиентов</a>
</p>
<table class="table">
<thead>
<tr>
@ -48,9 +43,19 @@
<td>
@Html.DisplayFor(modelItem => item.VisitDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.HearingId)
</td>
@if (item.HearingId == null)
{
<td>
Вакантно
</td>
}
else
{
<td>
@Html.DisplayFor(modelItem => item.HearingId)
</td>
}
<td>

View File

@ -28,14 +28,17 @@
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Visits">Визиты</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="VisitHearing">Связывание</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Отчёт по клиентам</a>
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="ClientHearingToFile">Отчёт по слушаниям</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Отчёт по слушаниям</a>
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="ClientsToPdfFile">Отчёт по слушаниям</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>

View File

@ -1,6 +1,8 @@
@{
@using LawCompanyContracts.ViewModels;
@using LawCompanyDataModels.Models;
@{
ViewData["Title"] = "CreateTaskAssigments";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<style>
</style>
@ -8,19 +10,22 @@
<h2 class="display-4">Создать визит</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Слушание</div>
<div class="col-8">
<select id="hearingId" name="hearingId" class="form-control" asp-items="@(new SelectList(@ViewBag.Hearings,"Id", "Id"))"></select>
</div>
</div>
<div class="row">
<div class="col-4">Дата и время</div>
<div class="col-8">
<input type="datetime-local" placeholder="Введите дату" name="visitDate" id="visitDate">
</div>
</div>
<div class="form-group">
<div class="col-8">
<select name="clientselect" class="form-control" multiple size="6" id="clientselect">
@foreach (var member in ViewBag.Clients)
{
<option value="@member.Id">@member.FIO</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">

View File

@ -1,22 +1,28 @@
@{
@using LawCompanyContracts.ViewModels;
@using LawCompanyDataModels.Models;
@{
ViewData["Title"] = "Обновить визит";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
<h2 class="display-4">Обновление визита</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Слушание</div>
<div class="col-8">
<select id="hearingId" name="hearingId" class="form-control" asp-items="@(new SelectList(@ViewBag.Hearings,"Id", "Id"))"></select>
</div>
</div>
<div class="row">
<div class="col-4">Дата</div>
<div class="col-8">
<input type="text" name="date" id="date" />
<input type="datetime-local" placeholder="Введите дату" name="visitDate" id="visitDate">
</div>
</div>
<div class="form-group">
<div class="col-8">
<select name="clientselect" class="form-control" multiple size="6" id="clientselect">
@foreach (var member in ViewBag.Clients)
{
<option value="@member.Id">@member.FIO</option>
}
</select>
</div>
</div>
<div class="row">

View File

@ -1,9 +1,8 @@
@using LawCompanyContracts.ViewModels;
@using LawCompanyContracts.ViewModels
@model List<ClientViewModel>
@{
ViewData["Title"] = "Клиенты";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="text-center">
<h1 class="display-4">Мои клиенты</h1>
@ -38,16 +37,20 @@
{
<tr>
<td id="id">
@Html.DisplayFor(modelItem => item.Id)
@Html.DisplayFor(modelItem =>
item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.FIO)
@Html.DisplayFor(modelItem =>
item.FIO)
</td>
<td>
@Html.DisplayFor(modelItem => item.Email)
@Html.DisplayFor(modelItem =>
item.Email)
</td>
<td>
@Html.DisplayFor(modelItem => item.Phone)
@Html.DisplayFor(modelItem =>
item.Phone)
</td>