Merge branch 'Worker_Raspaev' into Storekeeper

This commit is contained in:
dasha 2023-05-19 15:29:03 +04:00
commit c15757969f
22 changed files with 2806 additions and 260 deletions

View File

@ -152,6 +152,7 @@ namespace HardwareShopContracts.BusinessLogicsContracts
/// <param name="model"></param> /// <param name="model"></param>
public void SendByMailPurchaseReport(ReportBindingModel model) public void SendByMailPurchaseReport(ReportBindingModel model)
{ {
model.FileName = "temp.pdf";
_saveToPdf.GetPurchaseReportFile(new() _saveToPdf.GetPurchaseReportFile(new()
{ {
FileName = model.FileName, FileName = model.FileName,

View File

@ -26,7 +26,7 @@ namespace HardwareShopBusinessLogic.OfficePackage
ParagraphAlignment = PdfParagraphAlignmentType.Center ParagraphAlignment = PdfParagraphAlignmentType.Center
}); });
CreateTable(new List<string> { "5cm", "5cm", "5cm", "5cm", "5cm" }); CreateTable(new List<string> { "3cm", "4cm", "3cm", "4cm", "4cm" });
CreateRow(new PdfRowParameters CreateRow(new PdfRowParameters
{ {
@ -73,7 +73,7 @@ namespace HardwareShopBusinessLogic.OfficePackage
}); });
} }
} }
CreateParagraph(new PdfParagraph { Text = $"Итого: {info.ReportPurchases.Sum(x => x.PurchaseSum)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left });
SavePdf(info); SavePdf(info);
} }

View File

@ -24,8 +24,8 @@
</tbody> </tbody>
</table> </table>
<div class="col d-flex justify-content-evenly align-items-baseline"> <div class="col d-flex justify-content-evenly align-items-baseline">
<button type="button" class="btn btn-primary btn-lg m-2" id="savedoc">Сохранить в doc-формате</button> <button type="button" class="btn btn-primary m-2" id="savedoc">Сохранить в doc-формате</button>
<button type="button" class="btn btn-primary btn-lg m-2" id="saveexcel">Сохранить в xls-формате</button> <button type="button" class="btn btn-primary m-2" id="saveexcel">Сохранить в xls-формате</button>
</div> </div>
</div> </div>

View File

@ -10,7 +10,7 @@ namespace HardwareShopDatabaseImplement
{ {
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{ {
optionsBuilder.UseNpgsql("Host=localhost;Port=5433;Database=Computer_Hardware_Store;Username=user;Password=12345"); optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=Computer_Hardware_Store4;Username=postgres;Password=1234");
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
} }

View File

@ -122,7 +122,15 @@ namespace HardwareShopRestApi.Controllers
[HttpPost] [HttpPost]
public void SendByMailPurchaseReport(ReportBindingModel reportModel) public void SendByMailPurchaseReport(ReportBindingModel reportModel)
{ {
_reportWorkerLogic.SendByMailPurchaseReport(reportModel); try
{
_reportWorkerLogic.SendByMailPurchaseReport(reportModel);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка получения сведений по полученным пользователем комплектующим за период");
throw;
}
} }
} }

View File

@ -1,4 +1,5 @@
using HardwareShopContracts.BindingModels; using DocumentFormat.OpenXml.Spreadsheet;
using HardwareShopContracts.BindingModels;
using HardwareShopContracts.SearchModels; using HardwareShopContracts.SearchModels;
using HardwareShopContracts.ViewModels; using HardwareShopContracts.ViewModels;
using HardwareShopDatabaseImplement.Models; using HardwareShopDatabaseImplement.Models;
@ -56,9 +57,39 @@ namespace HardwareShopWorkerApp.Controllers
return View(); return View();
} }
[HttpGet]
public IActionResult Privacy() public IActionResult Privacy()
{ {
return View(); if (APIClient.User == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.User);
}
[HttpPost]
public void Privacy(string login, string email, string password)
{
if (APIClient.User == null)
{
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
}
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password))
{
throw new Exception("Введите логин, пароль и ФИО");
}
APIClient.PostRequest("api/user/updatedata", new UserBindingModel
{
Id = APIClient.User.Id,
Login = login,
Email = email,
Password = password
});
APIClient.User.Login = login;
APIClient.User.Email = email;
APIClient.User.Password = password;
Response.Redirect("MainWorker");
} }
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]

View File

@ -15,6 +15,7 @@
<div class=" col-sm-8"> <div class=" col-sm-8">
<div class="text-center"> <div class="text-center">
<h2 class="display-4">Сборки</h2> <h2 class="display-4">Сборки</h2>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#createModal">Добавить</button>
</div> </div>
<div class="text-center" name="id"> <div class="text-center" name="id">
<table class="table"> <table class="table">
@ -48,15 +49,15 @@
@Html.DisplayFor(modelItem => item.BuildName) @Html.DisplayFor(modelItem => item.BuildName)
</td> </td>
<td> <td>
<div> <a class="btn btn-success" asp-controller="Home" asp-action="LinkPurchase" asp-route-buildId="@item.Id">
<button onclick="getBuild(@item.Id)" type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#updateModal"> <i class="fa fa-paperclip fa-rotate-90" aria-hidden="true"></i>
<i class="fa fa-pencil" aria-hidden="true"></i> </a>
</button> <button onclick="getBuild(@item.Id)" type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#updateModal">
<button onclick="getBuild(@item.Id)" type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#deleteModal"> <i class="fa fa-pencil" aria-hidden="true"></i>
<i class="fa fa-trash" aria-hidden="true"></i> </button>
</button> <button onclick="getBuild(@item.Id)" type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">
<a class="btn btn-primary btn-lg mb-5" asp-controller="Home" asp-action="LinkPurchase" asp-route-buildId="@item.Id"></a> <i class="fa fa-trash" aria-hidden="true"></i>
</div> </button>
</td> </td>
</tr> </tr>
} }
@ -65,13 +66,6 @@
</div> </div>
</div> </div>
<div class="text-center d-flex flex-column mt-5">
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#createModal">Добавить</button>
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#exampleModal">Изменить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Удалить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Обновить</button>
<button type="submit" class="btn btn-primary btn-lg mb-5">Привязать сборку</button>
</div>
<div class="modal fade" id="createModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="createModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">

View File

@ -17,6 +17,7 @@
<div class=" col-sm-8"> <div class=" col-sm-8">
<div class="text-center"> <div class="text-center">
<h2 class="display-4">Комментарии</h2> <h2 class="display-4">Комментарии</h2>
<button type="button" class="btn btn-primary " data-bs-toggle="modal" data-bs-target="#createModal">Добавить</button>
</div> </div>
<div class="text-center" name="id"> <div class="text-center" name="id">
<table class="table"> <table class="table">
@ -29,7 +30,7 @@
Текст Текст
</th> </th>
<th> <th>
Название сборки к которой относиться комментарий Название сборки к которой относится комментарий
</th> </th>
<th> <th>
Действия Действия
@ -50,10 +51,12 @@
@Html.DisplayFor(modelItem => item.BuildName) @Html.DisplayFor(modelItem => item.BuildName)
</td> </td>
<td> <td>
<div> <button onclick="getComment(@item.Id)" type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#updateModal">
<button onclick="getComment(@item.Id)" type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#updateModal">Изменить</button> <i class="fa fa-pencil" aria-hidden="true"></i>
<button onclick="getComment(@item.Id)" type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#deleteModal">Удалить</button> </button>
</div> <button onclick="getComment(@item.Id)" type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>
</td> </td>
</tr> </tr>
} }
@ -61,10 +64,6 @@
</table> </table>
</div> </div>
</div> </div>
<div class="text-center d-flex flex-column mt-5">
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#createModal">Добавить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Обновить</button>
</div>
<div class="modal fade" id="createModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="createModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">

View File

@ -16,7 +16,6 @@
<h1 class="display-6">Товары</h1> <h1 class="display-6">Товары</h1>
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
<button type="button" class="btn btn-primary mx-2 mt-3" data-bs-toggle="modal" data-bs-target="#exampleModal">Добавить</button> <button type="button" class="btn btn-primary mx-2 mt-3" data-bs-toggle="modal" data-bs-target="#exampleModal">Добавить</button>
<button type="button" class="btn btn-primary mx-2 mt-3">Удалить</button>
</div> </div>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
@ -148,69 +147,3 @@
</script> </script>
} }
@*<form class="d-flex justify-content-evenly">
<div class=" col-sm-8">
<div class="text-center">
<h2 class="display-4">Товары</h2>
</div>
<div class="text-center" name="id">
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Название товара
</th>
<th>
Цена
</th>
<th>
Количество
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="text-center d-flex flex-column mt-5">
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#exampleModal">Добавить</button>
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#exampleModal">Изменить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Удалить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Обновить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Сохранить</button>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Товар</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
</div>
<div class="modal-body">
<div>
<label class="form-label">Товар</label>
<select class="form-select">
<option value="1">Товар 1</option>
<option value="2">Товар 2</option>
</select>
</div>
<div>
<label class="form-label">Количество</label>
<input type="number" class="form-control">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
<button type="button" class="btn btn-primary">Сохранить</button>
</div>
</div>
</div>
</div>
</form>
*@

View File

@ -13,7 +13,7 @@
<div class="text-center"> <div class="text-center">
@{ @{
<p> <p>
<button type="button" onclick="getBuild()" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#createModal">Добавить</button> <button type="button" onclick="getBuild()" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#createModal">Добавить</button>
</p> </p>
<table class="table"> <table class="table">
<thead> <thead>
@ -224,11 +224,11 @@
</div> </div>
</div> </div>
<div class="text-center d-flex flex-column mt-5"> <div class="text-center d-flex flex-column mt-5">
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#exampleModal">Добавить</button> <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">Добавить</button>
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#exampleModal">Изменить</button> <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">Изменить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Удалить</button> <button type="button" class="btn btn-primary">Удалить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Обновить</button> <button type="button" class="btn btn-primary">Обновить</button>
<button type="submit" class="btn btn-primary btn-lg mb-5">Сохранить</button> <button type="submit" class="btn btn-primary">Сохранить</button>
</div> </div>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">

View File

@ -0,0 +1,29 @@
@using HardwareShopContracts.ViewModels;
@model UserViewModel
@{
ViewData["Title"] = "Privacy Policy";
Layout = "~/Views/Shared/_LayoutWorker.cshtml";
}
<div class="text-center">
<h2 class="display-4">Личные данные</h2>
</div>
<form method="post" class="d-flex flex-column align-items-center">
<div class="col-sm-3">
<label class="form-label">Почта:</label>
<input type="text" class="form-control" name="email" value="@Model.Email">
</div>
<div class="col-sm-3">
<label class="form-label">Пароль:</label>
<input type="text" class="form-control" name="password" value="@Model.Password">
</div>
<div class="col-sm-3">
<label class="form-label">Логин:</label>
<input type="text" class="form-control" name="login" value="@Model.Login">
</div>
<div class="col-sm-2 d-flex justify-content-evenly align-items-baseline">
<button type="submit" class="btn btn-primary mt-3 px-4">Подтвердить</button>
</div>
</form>

View File

@ -19,7 +19,7 @@
<a asp-controller="Home" asp-action="CreatePurchase" class="btn btn-primary mx-2">Добавить</a> <a asp-controller="Home" asp-action="CreatePurchase" class="btn btn-primary mx-2">Добавить</a>
<button type="button" class="btn btn-primary mx-2" id="delete">Удалить покупку</button> <button type="button" class="btn btn-primary mx-2" id="delete">Удалить покупку</button>
<button type="button" class="btn btn-primary mx-2" id="done">Выдан</button> <button type="button" class="btn btn-primary mx-2" id="done">Выдан</button>
<button type="button" class="btn btn-primary mx-2" id="update">Обновить</button> <button type="button" class="btn btn-primary mx-2" id="update">Изменить</button>
</p> </p>
</div> </div>
<div class="text-center"> <div class="text-center">
@ -56,24 +56,12 @@
<td> <td>
@Html.DisplayFor(modelItem => item.PurchaseStatus) @Html.DisplayFor(modelItem => item.PurchaseStatus)
</td> </td>
@*<td>
<div>
<button onclick="getBuild(@item.Id)" type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#updateModal">Изменить</button>
<button onclick="getBuild(@item.Id)" type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#deleteModal">Удалить</button>
</div>
</td>*@
</tr> </tr>
} }
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="text-center d-flex flex-column mt-5">
@*<button type="submit" class="btn btn-primary btn-lg mb-5">Изменить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Удалить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Обновить</button>*@
</div>
} }
</div> </div>

View File

@ -17,7 +17,6 @@
<h1 class="display-6">Товары</h1> <h1 class="display-6">Товары</h1>
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
<button type="button" class="btn btn-primary mx-2 mt-3" data-bs-toggle="modal" data-bs-target="#exampleModal">Добавить</button> <button type="button" class="btn btn-primary mx-2 mt-3" data-bs-toggle="modal" data-bs-target="#exampleModal">Добавить</button>
<button type="button" class="btn btn-primary mx-2 mt-3">Удалить</button>
</div> </div>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
@ -68,6 +67,7 @@
const saveBtn = document.getElementById("createpurchase"); const saveBtn = document.getElementById("createpurchase");
const countElem = document.getElementById("count"); const countElem = document.getElementById("count");
const resultTable = document.getElementById("result"); const resultTable = document.getElementById("result");
const totalSum = document.getElementById("sum");
submitGoodBtn.addEventListener("click", () => { submitGoodBtn.addEventListener("click", () => {
console.log('try to add good') console.log('try to add good')
@ -138,7 +138,10 @@
</div><td/></tr>` </div><td/></tr>`
count++; count++;
console.log(elem); console.log(elem);
price += elem.good.price * elem.count
}) })
totalSum.value = Math.round(price * 110) / 100
console.log(totalSum.value);
} }
function deleteGood(id) { function deleteGood(id) {
@ -174,69 +177,3 @@
</script> </script>
} }
@*<form class="d-flex justify-content-evenly">
<div class=" col-sm-8">
<div class="text-center">
<h2 class="display-4">Товары</h2>
</div>
<div class="text-center" name="id">
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Название товара
</th>
<th>
Цена
</th>
<th>
Количество
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="text-center d-flex flex-column mt-5">
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#exampleModal">Добавить</button>
<button type="button" class="btn btn-primary btn-lg mb-5" data-bs-toggle="modal" data-bs-target="#exampleModal">Изменить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Удалить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Обновить</button>
<button type="button" class="btn btn-primary btn-lg mb-5">Сохранить</button>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Товар</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
</div>
<div class="modal-body">
<div>
<label class="form-label">Товар</label>
<select class="form-select">
<option value="1">Товар 1</option>
<option value="2">Товар 2</option>
</select>
</div>
<div>
<label class="form-label">Количество</label>
<input type="number" class="form-control">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
<button type="button" class="btn btn-primary">Сохранить</button>
</div>
</div>
</div>
</div>
</form>
*@

View File

@ -3,29 +3,15 @@
Layout = "~/Views/Shared/_LayoutWorker.cshtml"; Layout = "~/Views/Shared/_LayoutWorker.cshtml";
} }
<h4 class="fw-bold">Отчет по покупкам</h4> <div class="d-flex flex-column align-items-center">
<div class="col-sm-3">
<div id="error-div-shell" class="error-div-shell"> <label class="form-label">С</label>
<div> <input type="date" class="form-control" name="dateFrom" id="date-from-input">
<p id="error-p" class="error-p mb-2"></p> <label class="form-label">По</label>
<input type="date" class="form-control" name="dateTo" id="date-to-input">
</div> </div>
</div> <button type="submit" class="btn btn-primary mt-3 px-4" id="generate-button">Вывод на страницу</button>
<button type="submit" class="btn btn-primary mt-3 px-4" id="send-by-mail-button">Отправить на почту</button>
<div class="d-flex flex-wrap gap-1 align-items-end mb-2">
<div class="mb-2">
<p class="mb-0">Дата начала:</p>
<input id="date-from-input" class="form-control" type="date" />
</div>
<div class="mb-2">
<p class="mb-0">Дата конца:</p>
<input id="date-to-input" class="form-control" type="date" />
</div>
<button id="generate-button" class="button-primary text-button mb-2">
Показать
</button>
<button id="send-by-mail-button" class="button-primary text-button mb-2">
На почту
</button>
</div> </div>
<p class="mb-0"> <p class="mb-0">
@ -34,21 +20,20 @@
<span>&nbsp;по&nbsp;</span> <span>&nbsp;по&nbsp;</span>
<span id="date-to-span" class="fw-bold">...</span> <span id="date-to-span" class="fw-bold">...</span>
</p> </p>
<div class="table-shell mb-2 border">
<table class="table mb-0"> <table class="table">
<thead class="table-head"> <thead>
<tr> <tr>
<th>Номер покупки</th> <th scope="col">Номер покупки</th>
<th>Дата покупки</th> <th scope="col">Дата покупки</th>
<th>Сумма покупки</th> <th scope="col">Сумма покупки</th>
<th>Комментарии</th> <th scope="col">Комментарии</th>
<th>Комплектующие</th> <th scope="col">Комплектующие</th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody"> <tbody id="tbody">
</tbody> </tbody>
</table> </table>
</div>
@section Scripts @section Scripts
{ {
@ -72,9 +57,6 @@
"DateFrom": dateFrom, "DateFrom": dateFrom,
"DateTo": dateTo "DateTo": dateTo
}; };
if (!validate(reportModel)) {
return;
}
$.ajax({ $.ajax({
url: "/home/WorkerReport", url: "/home/WorkerReport",
type: "POST", type: "POST",
@ -94,9 +76,6 @@
"DateFrom": dateFrom, "DateFrom": dateFrom,
"DateTo": dateTo "DateTo": dateTo
}; };
if (!validate(reportModel)) {
return;
}
$.ajax({ $.ajax({
url: "/home/SendByMailPurchaseReport", url: "/home/SendByMailPurchaseReport",
type: "POST", type: "POST",
@ -106,14 +85,6 @@
}); });
}); });
dateFromInput.addEventListener("input", () => {
errorDivShell.style.gridTemplateRows = "0fr";
});
dateToInput.addEventListener("input", () => {
errorDivShell.style.gridTemplateRows = "0fr";
});
// ![Event listeners] // ![Event listeners]
// [HTML gen] // [HTML gen]
@ -167,25 +138,6 @@
// [Other] // [Other]
const validate = function (reportModel) {
if (isNaN(reportModel["DateFrom"])) {
errorDivShell.style.gridTemplateRows = "1fr";
errorP.innerHTML = "Выберите начальную дату";
return false;
}
if (isNaN(reportModel["DateTo"])) {
errorDivShell.style.gridTemplateRows = "1fr";
errorP.innerHTML = "Выберите конечную дату";
return false;
}
if (reportModel["DateFrom"] >= reportModel["DateTo"]) {
errorDivShell.style.gridTemplateRows = "1fr";
errorP.innerHTML = "Начальная дата должна быть меньше конечной";
return false;
}
return true;
}
const getDate = function (iso) { const getDate = function (iso) {
const year = iso.substring(0, 4); const year = iso.substring(0, 4);
const month = iso.substring(5, 7); const month = iso.substring(5, 7);

View File

@ -24,8 +24,8 @@
</tbody> </tbody>
</table> </table>
<div class="col d-flex justify-content-evenly align-items-baseline"> <div class="col d-flex justify-content-evenly align-items-baseline">
<button type="button" class="btn btn-primary btn-lg m-2" id="savedoc">Сохранить в doc-формате</button> <button type="button" class="btn btn-primary m-2" id="savedoc">Сохранить в doc-формате</button>
<button type="button" class="btn btn-primary btn-lg m-2" id="saveexcel">Сохранить в xls-формате</button> <button type="button" class="btn btn-primary m-2" id="saveexcel">Сохранить в xls-формате</button>
</div> </div>
</div> </div>

View File

@ -36,6 +36,9 @@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="WorkerReport">Отчёт</a> <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="WorkerReport">Отчёт</a>
</li> </li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB