some fixes, but still got a work to do

This commit is contained in:
Никита Волков 2024-08-28 13:31:47 +04:00
parent 7b7ced25dd
commit 34f803c11e
19 changed files with 43 additions and 240 deletions

View File

@ -71,14 +71,14 @@ namespace StoreKeeperWebApp.Controllers
}
[HttpPost]
public void CreateCosmetics(string name, string brand, double price, int laborCost)
public void CreateCosmetics(string name, double price, int laborCost)
{
if (APIStoreKeeper.Storekeeper == null)
{
throw new Exception("Необходимо авторизоваться!");
}
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(brand) || price <= 0 || laborCost <= 0)
if (string.IsNullOrEmpty(name) || price <= 0 || laborCost <= 0)
{
throw new Exception("Введены не все данные!");
}

View File

@ -103,7 +103,7 @@ namespace StoreKeeperWebApp.Controllers
APIStoreKeeper.Storekeeper = _logic.ReadElement(new StoreKeeperSearchModel
{
StoreKeeperEmail = login,
StoreKeeperLogin = login,
StoreKeeperPassword = password
});
if (APIStoreKeeper.Storekeeper == null)
@ -125,16 +125,16 @@ namespace StoreKeeperWebApp.Controllers
return View();
}
[HttpPost]
public void Register(string fullname, string email, string password, string phone)
public void Register(string fio, string email, string password, string phone)
{
if (string.IsNullOrEmpty(fullname) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(phone))
if (string.IsNullOrEmpty(fio) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(phone))
{
throw new Exception("Ââåäåíû íå âñå äàííûå!");
}
_logic.Create(new StoreKeeperBindingModel
{
StoreKeeperFIO = fullname,
StoreKeeperFIO = fio,
StoreKeeperEmail = email,
StoreKeeperPassword = password,
StoreKeeperLogin = email,

View File

@ -28,7 +28,7 @@ namespace StoreKeeperWebApp.Controllers
}
[HttpGet]
public LaborCostViewModel? GetLaborCost(int id)
public LaborCostViewModel? GetLaborCosts(int id)
{
try
{
@ -45,7 +45,7 @@ namespace StoreKeeperWebApp.Controllers
}
[HttpGet]
public IActionResult LaborCost()
public IActionResult LaborCosts()
{
if (APIStoreKeeper.Storekeeper == null)
{
@ -56,7 +56,7 @@ namespace StoreKeeperWebApp.Controllers
}
[HttpGet]
public IActionResult CreateLaborCost()
public IActionResult CreateLaborCosts()
{
if (APIStoreKeeper.Storekeeper == null)
{
@ -72,7 +72,7 @@ namespace StoreKeeperWebApp.Controllers
}
[HttpPost]
public void CreateLaborCost(int hours, string difficulty, int cosmeticId)
public void CreateLaborCosts(int hours, string difficulty, int cosmeticId)
{
if (APIStoreKeeper.Storekeeper == null)
{
@ -110,12 +110,12 @@ namespace StoreKeeperWebApp.Controllers
});
}
Response.Redirect("/LaborCost/LaborCost");
Response.Redirect("/LaborCost/LaborCosts");
}
[HttpGet]
public IActionResult UpdateLaborCost(int id)
public IActionResult UpdateLaborCosts(int id)
{
if (APIStoreKeeper.Storekeeper == null)
{
@ -134,7 +134,7 @@ namespace StoreKeeperWebApp.Controllers
}
[HttpPost]
public void UpdateLaborCost(int hours, string difficulty)
public void UpdateLaborCosts(int hours, string difficulty)
{
if (APIStoreKeeper.Storekeeper == null)
{
@ -153,7 +153,7 @@ namespace StoreKeeperWebApp.Controllers
StoreKeeperId = APIStoreKeeper.Storekeeper.Id
});
Response.Redirect("/LaborCost/LaborCost");
Response.Redirect("/LaborCost/LaborCosts");
}
/// <summary>
@ -161,7 +161,7 @@ namespace StoreKeeperWebApp.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
public void DeleteLaborCost(int id)
public void DeleteLaborCosts(int id)
{
if (APIStoreKeeper.Storekeeper == null)
{
@ -173,7 +173,7 @@ namespace StoreKeeperWebApp.Controllers
Id = id
});
Response.Redirect("/LaborCost/LaborCost");
Response.Redirect("/LaborCost/LaborCosts");
}
}
}

View File

@ -27,7 +27,6 @@
<tr>
<th>Номер</th>
<th>Название</th>
<th>Бренд</th>
<th>Цена</th>
<th></th>
<th></th>

View File

@ -1,53 +0,0 @@
@using BeautyStudioContracts.ViewModels
@{
ViewData["Title"] = "Косметика";
}
<h4 class="fw-bold">Косметика</h4>
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div class="d-flex mb-2 gap-1">
<a asp-controller="Cosmetic" asp-action="Create" class="btn button-primary">
Создать
</a>
<button id="update-button" class="btn button-primary">
Обновить
</button>
<button id="delete-button" class="btn button-primary me-5">
Удалить
</button>
</div>
<div class="d-flex mb-2 gap-1">
<div class="input-group" style="width: auto;">
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
</div>
<a href="/Home/Cars?page=@ViewBag.Page" id="go-button" class="btn btn-lg button-primary">
Перейти
</a>
</div>
</div>
<div class="border">
<table class="table mb-0">
<thead>
<tr>
<th>Бренд</th>
<th>Наименование косметики</th>
<th>Стоимость</th>
</tr>
</thead>
<tbody>
@foreach (var item in ViewBag.Cosmetic)
{
<tr class="table-row" id="row-@item.Id">
<td>@item.Brand</td>
<td>@item.CosmeticName</td>
<td>@item.CosmeticPrice</td>
</tr>
}
</tbody>
</table>
</div>
<script src="~/js/cosmetic.js" asp-append-version="true"></script>

View File

@ -1,8 +1,11 @@
@{
ViewData["Title"] = "HomePage";
}
<h1 class="display-4 text-center">текст в центре окей</h1>
<h1 class="display-4 text-center">
Vēni. Vidi. Vici.
Пришел. Увидел. Победил.
</h1>
<div class="text-center">
<p><img src="https://sun9-39.userapi.com/impg/o2-mQK-4UlJ0wpYtHij7XS_LcKdrXrr4Rs1Yuw/WKELgu4v8do.jpg?size=1200x859&quality=96&sign=447006c6f7985c41d834b01b0d6d7993&type=album" alt="Logo" /></p>
<p><img src="https://sun9-76.userapi.com/impg/vI6SBomCNhEqLdfaxCFJk49LESbnjnLYHlG8Nw/1coG-1E4Glk.jpg?size=1000x1000&quality=96&sign=f3e2bd04ae751caf654fdba7b84be2bb&type=album" alt="Logo" /></p>
</div>

View File

@ -1,51 +0,0 @@
@using BeautyStudioContracts.ViewModels
@{
ViewData["Title"] = "Трудозатраты";
}
<h4 class="fw-bold">Трудозатраты</h4>
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div class="d-flex mb-2 gap-1">
<a asp-controller="LaborCosts" asp-action="Create" class="button-primary">
Создать
</a>
<a id="update-button" class="button-primary">
Обновить
</a>
<button id="delete-button" class="button-primary me-5">
Удалить
</button>
</div>
<div class="d-flex mb-2 gap-1">
<div class="input-group" style="width: auto;">
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
</div>
<a href="/Home/Cosmetics?page=@ViewBag.Page" id="go-button" class="button-primary">
Перейти
</a>
</div>
</div>
<div class="border">
<table class="table mb-0">
<thead>
<tr>
<th>Количество часов</th>
<th>Сложность</th>
</tr>
</thead>
<tbody>
@foreach (var item in ViewBag.LaborCosts)
{
<tr class="table-row" id="row-@item.Id">
<td>@item.NumberHours</td>
<td>@item.Difficlty</td>
</tr>
}
</tbody>
</table>
</div>
<script src="~/js/laborcosts.js" asp-append-version="true"></script>

View File

@ -1,52 +0,0 @@
@{
ViewData["Title"] = "Список косметики по процедурам";
}
<h4 class="fw-bold">Список косметики по процедурам</h4>
@{
if (ViewBag.IsAllowed == false)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<div class="mb-2">
<button id="word-button" class="button-primary">
Word
</button>
<button id="excel-button" class="button-primary">
Excel
</button>
</div>
<p class="mb-0">Выбранные процедуры:</p>
<div class="table-shell border">
<table class="table mb-0">
<thead class="table-head">
<tr>
<th>Наименование</th>
<th>Стоимость</th>
<th></th>
</tr>
</thead>
<tbody id="tbody">
<tr>
<td>Не выбрано</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<p class="mb-0">Добавить процедуру:</p>
<div class="d-flex gap-1 mb-2">
<select class="form-select mb-0" id="procedure-select"></select>
<button id="add-button" class="button-primary">
Добавить
</button>
</div>
<script src="~/js/list.js" asp-append-version="true"></script>
}

View File

@ -5,18 +5,25 @@
<h4 class="fw-bold">Регистрация</h4>
<form method="post">
<div class="mb-3">
<label for="login" class="form-label">Логин:</label>
<input id="login" name="login" type="text" class="form-control" aria-label="Login">
</div>
<div class="mb-3">
<label for="password" class="form-label">Пароль:</label>
<input id="password" name="password" type="password" class="form-control" aria-label="Password">
<label for="fio" class="form-label">Ваше полное имя:</label>
<input id="fio" name="fio" type="text" class="form-control" aria-label="StoreKeeperFIO">
</div>
<div class="mb-3">
<label for="email" class="form-label">Адрес электронной почты:</label>
<input id="email" name="email" type="email" class="form-control" aria-label="Email">
<input id="email" name="email" type="email" class="form-control" aria-label="StoreKeeperEmail">
</div>
<div class="mb-3">
<label for="password" class="form-label">Пароль:</label>
<input id="password" name="password" type="password" class="form-control" aria-label="StoreKeeperPassword">
</div>
<div class="mb-3">
<label for="email" class="form-label">Номер телефона:</label>
<input id="phone" name="phone" type="text" placeholder="+79370350065" minlenght ="12" maxlength="12" class="form-control" aria-label="StoreKeeperPhone">
</div>
<div>
<button type="submit" class="btn button-primary">
Регистрация

View File

@ -1,53 +0,0 @@
@using BeautyStudioContracts.ViewModels
@{
ViewData["Title"] = "Услуга";
}
<h4 class="fw-bold">Услуги</h4>
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div class="d-flex mb-2 gap-1">
<a asp-controller="Service" asp-action="Create" class="button-primary">
Создать
</a>
<a id="update-button" class="button-primary">
Обновить
</a>
<a id="bind-button" class="button-primary">
Связать с косметикой
</a>
<button id="delete-button" class="button-primary me-5">
Удалить
</button>
</div>
<div class="d-flex mb-2 gap-1">
<div class="input-group" style="width: auto;">
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
</div>
<a href="/Home?page=@ViewBag.Page" id="go-button" class="button-primary">
Перейти
</a>
</div>
</div>
<div class="border">
<table class="table mb-0">
<thead>
<tr>
<th>Наименование</th>
<th>Стоимость</th>
</tr>
</thead>
<tbody>
@foreach (var item in ViewBag.Service)
{
<tr class="table-row" id="row-@item.Id">
<td>@item.ServiceName</td>
<td>@item.ServicePrice</td>
</tr>
}
</tbody>
</table>
</div>
<script src="~/js/service.js" asp-append-version="true"></script>

View File

@ -3,7 +3,7 @@
@model LaborCostViewModel
@{
ViewData["Title"] = "Редактирование трудозатраты";
ViewData["Title"] = "Редактирование трудозатрат";
}
<div class="text-center">

View File

@ -3,7 +3,7 @@
@model ServiceViewModel
@{
ViewData["Title"] = "Создание услуги";
ViewData["Title"] = "Редактирование услуг";
}
<div class="text-center">

View File

@ -29,13 +29,16 @@
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Авторизация</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Service" asp-action="Service">Услуги</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Service" asp-action="Services">Услуги</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="LaborCosts" asp-action="LaborCosts">Трудозатраты</a>
<a class="nav-link text-dark" asp-area="" asp-controller="LaborCost" asp-action="LaborCosts">Трудозатраты</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Cosmetic" asp-action="Cosmetic">Косметика</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Cosmetic" asp-action="Cosmetics">Косметика</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Reports">Отчет</a>
</li>
</ul>
</div>