This commit is contained in:
Николай 2023-04-03 10:39:43 +04:00
commit 26966f9c8c
30 changed files with 411 additions and 215 deletions

View File

@ -3,7 +3,6 @@ using HardwareShopContracts.BindingModels;
using HardwareShopContracts.ViewModels; using HardwareShopContracts.ViewModels;
using HardwareShopDataModels.Enums; using HardwareShopDataModels.Enums;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Data;
using System.Diagnostics; using System.Diagnostics;
namespace HardwareShopClientApp.Controllers namespace HardwareShopClientApp.Controllers
@ -17,7 +16,6 @@ namespace HardwareShopClientApp.Controllers
_logger = logger; _logger = logger;
} }
[HttpGet]
public IActionResult Register() public IActionResult Register()
{ {
return View(); return View();
@ -43,10 +41,6 @@ namespace HardwareShopClientApp.Controllers
public IActionResult Index() public IActionResult Index()
{ {
if (APIClient.User == null)
{
return Redirect("~/Home/Enter");
}
return View(); return View();
} }
@ -61,15 +55,13 @@ namespace HardwareShopClientApp.Controllers
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
} }
[HttpGet]
public IActionResult Enter() public IActionResult Enter()
{ {
return View(); return View();
} }
[HttpPost] [HttpPost]
public IActionResult Enter(string email, string password) public void Enter(string email, string password)
{ {
if (string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password)) if (string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password))
{ {
@ -82,20 +74,12 @@ namespace HardwareShopClientApp.Controllers
} }
if ((int)APIClient.User.Role == 1) if ((int)APIClient.User.Role == 1)
{ {
return RedirectToAction("MainWorker", "Worker"); RedirectToAction("MainWorker", "Worker");
} }
else else
{ {
return Redirect("Index"); RedirectToAction("Goods", "Storekeeper");
} }
} }
[HttpGet]
public IActionResult MainWorker()
{
return View();
}
} }
} }

View File

@ -0,0 +1,58 @@
using Microsoft.AspNetCore.Mvc;
namespace HardwareShopClientApp.Controllers
{
public class StorekeeperController : Controller
{
private readonly ILogger<HomeController> _logger;
public StorekeeperController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult CreateGood()
{
return View();
}
public IActionResult LinkBuilds()
{
return View();
}
public IActionResult CreateComponent()
{
return View();
}
public IActionResult MainStorekeeper()
{
return View();
}
public IActionResult Components()
{
return View();
}
public IActionResult Goods()
{
return View();
}
public IActionResult Orders()
{
return View();
}
public IActionResult ListBuilds()
{
return View();
}
public IActionResult Report()
{
return View();
}
}
}

View File

@ -7,14 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Content Remove="Views\Storekeeper\Components.cshtml" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.13" />
</ItemGroup>
<ItemGroup>
<None Include="Views\Storekeeper\Components.cshtml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup> </ItemGroup>

View File

@ -1,9 +1,20 @@
@{ @{
ViewData["Title"] = "Enter"; ViewData["Title"] = "Enter";
} }
@section Header {} @section Header {
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
</header>
}
<div class="text-center"> <div class="text-center">
<h2 class="display-4">Вход в приложение</h2> <h2 class="display-4">Вход</h2>
</div> </div>
<form method="post" class="d-flex flex-column align-items-center"> <form method="post" class="d-flex flex-column align-items-center">
<div class="col-sm-3"> <div class="col-sm-3">
@ -14,10 +25,8 @@
<label class="form-label">Пароль</label> <label class="form-label">Пароль</label>
<input type="password" class="form-control" name="password"> <input type="password" class="form-control" name="password">
</div> </div>
<div class="col-sm-2 d-flex justify-content-evenly align-items-baseline"> <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> <button type="submit" class="btn btn-primary mt-3 px-4">Подтвердить</button>
<a asp-action="Register">Регистрация</a> </div><a asp-action="Register">Регистрация</a>
</div>
</form> </form>

View File

@ -1,99 +1,35 @@
@{ @{
ViewData["Title"] = "Home Page"; ViewData["Title"] = "Enter";
} }
@using HardwareShopContracts.ViewModels
@model List<PurchaseViewModel>
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
</button> <span class="navbar-toggler-icon"></span>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between"> </button>
<ul class="navbar-nav flex-grow-1"> <div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<li class="nav-item"> <ul class="navbar-nav flex-grow-1">
<a class="nav-link text-dark" asp-area="" asp-controller="Worker" asp-action="Purchases">Purchases</a> <li class="nav-item">
</li> <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>
<li class="nav-item"> </li>
<a class="nav-link text-dark" asp-area="" asp-controller="Worker" asp-action="Builds">Builds</a> <li class="nav-item">
</li> <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
<li class="nav-item"> </li>
<a class="nav-link text-dark" asp-area="" asp-controller="Worker" asp-action="Comments">Comments</a> <li class="nav-item">
</li> <a class="nav-link text-dark" asp-area="" asp-controller="Worker" asp-action="MainWorker">Работник</a>
<li class="nav-item"> </li>
<a class="nav-link text-dark" asp-area="" asp-controller="Worker" asp-action="listComponents">listComponents</a> <li class="nav-item">
</li> <a class="nav-link text-dark" asp-area="" asp-controller="Storekeeper" asp-action="MainStorekeeper">Кладовщик</a>
<li class="nav-item"> </li>
<a class="nav-link text-dark" asp-area="" asp-controller="Worker" asp-action="WorkerReport">WorkerReport</a> </ul>
</li> </div>
</ul> </div>
</div> </nav>
</div> </header>
</nav>
</header>
} }
<div class="d-flex justify-content-center">
<div class="text-center"> <img src="images/logo.png"/>
<h2 class="display-4">Регистрация</h2> </div>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Блюдо
</th>
<th>
Дата создания
</th>
<th>
Количество
</th>
<th>
Сумма
</th>
<th>
Статус
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.DatePurchase)
</td>
<td>
@Html.DisplayFor(modelItem => item.Sum)
</td>
<td>
@Html.DisplayFor(modelItem => item.PurchaseStatus)
</td>
<td>
@Html.DisplayFor(modelItem => item.UserLogin)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -2,6 +2,16 @@
ViewData["Title"] = "Privacy Policy"; ViewData["Title"] = "Privacy Policy";
} }
@section Header { @section Header {
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
</header>
} }
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>

View File

@ -1,7 +1,18 @@
@{ @{
ViewData["Title"] = "Register"; ViewData["Title"] = "Register";
} }
@section Header {} @section Header {
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
</header>
}
<div class="text-center"> <div class="text-center">
<h2 class="display-4">Регистрация</h2> <h2 class="display-4">Регистрация</h2>
</div> </div>

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - HardwareShopClientApp</title> <title>@ViewData["Title"] - Магазин компьютерной техники</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" /> <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" /> <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/HardwareShopClientApp.styles.css" asp-append-version="true" /> <link rel="stylesheet" href="~/HardwareShopClientApp.styles.css" asp-append-version="true" />
@ -18,7 +18,7 @@
<footer class="border-top footer text-muted"> <footer class="border-top footer text-muted">
<div class="container"> <div class="container">
&copy; 2023 - HardwareShopClientApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a> &copy; 2023 - "Ты ж программист" - Магазин компьютерной техники <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</div> </div>
</footer> </footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script> <script src="~/lib/jquery/dist/jquery.min.js"></script>

View File

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - Магазин компьютерной техники</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/HardwareShopClientApp.styles.css" asp-append-version="true" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Storekeeper" asp-action="Components">Комплектующие</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Storekeeper" asp-action="Goods">Товары</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Storekeeper" asp-action="Orders">Заказы</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Storekeeper" asp-action="ListBuilds">Получение списка</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Storekeeper" asp-action="Report">Отчет</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer b-xtjzatmnc3="" class="border-top footer text-muted">
<div class="container">
© 2023 - "Ты ж программист" - Магазин компьютерной техники <a href="/Home/Privacy">Privacy</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

View File

@ -1,10 +1,38 @@
<!DOCTYPE html> @using HardwareShopContracts.ViewModels
<html> @{
<head> ViewData["Title"] = "Комплектующие";
<meta charset="utf-8" /> Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
<title></title> }
</head>
<body>
</body> <div class="text-center">
</html> <h1 class="display-4">Комплектующие</h1>
</div>
<div class="text-center">
@{
<p>
<a asp-action="CreateComponent" class="mx-2">Создать комплектующее</a>
<a asp-action="Components" class="mx-2">Изменить комплектующее</a>
<a asp-action="Components" class="mx-2">Удалить комплектующее</a>
<a asp-action="LinkBuilds" class="mx-2">Привязка сборок</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Название
</th>
<th>
Цена
</th>
<th>
Сборки
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
}
</div>

View File

@ -0,0 +1,22 @@
@{
ViewData["Title"] = "Создание комплектующего";
Layout = "~/Views/Shared/_LayoutStorekeeper.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">
</div>
<div class="col-sm-3">
<label class="form-label">Стоимость</label>
<input type="number" step="0.01" class="form-control" name="cost">
</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

@ -0,0 +1,32 @@
@{
ViewData["Title"] = "Создание товара";
Layout = "~/Views/Shared/_LayoutStorekeeper.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">
</div>
<div class="col-sm-3">
<label class="form-label">Цена</label>
<input type="number" step="0.01" class="form-control" name="price" readonly>
</div>
<table class="table table-hover">
<thead>
<tr>
<th id="name" scope="col">Комплектующее</th>
<th id="cost" scope="col">Стоимость</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<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

@ -0,0 +1,26 @@
@{
ViewData["Title"] = "Создание заказа";
Layout = "~/Views/Shared/_LayoutStorekeeper.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>
<select class="form-control" name="good"></select>
</div>
<div class="col-sm-3">
<label class="form-label">Количество</label>
<input type="number" class="form-control" name="count">
</div>
<div class="col-sm-3">
<label class="form-label">Сумма</label>
<input type="number" step="0.01" class="form-control" name="sum" readonly>
</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

@ -0,0 +1,36 @@
@using HardwareShopContracts.ViewModels
@{
ViewData["Title"] = "Товары";
Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
}
<div class="text-center">
<h1 class="display-4">Товары</h1>
</div>
<div class="text-center">
@{
<p>
<a asp-action="CreateGood" class="mx-2">Создать товар</a>
<a asp-action="Goods" class="mx-2">Изменить товар</a>
<a asp-action="Goods" class="mx-2">Удалить товар</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Название
</th>
<th>
Цена
</th>
<th>
Комплектующие
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
}
</div>

View File

@ -0,0 +1,29 @@
@using HardwareShopContracts.ViewModels
@{
ViewData["Title"] = "Привязка сборок";
Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
}
<div class="text-center">
<h1 class="display-4">Привязка сборок</h1>
</div>
<form method="post" class="d-flex flex-column align-items-center">
<div class="col-sm-3">
<label class="form-label">Комплектующее</label>
<select class="form-control" name="component"></select>
</div>
<table class="table table-hover">
<thead>
<tr>
<th id="name" scope="col">Сборка</th>
<th id="price" scope="col">Цена</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<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

@ -0,0 +1,9 @@
@using HardwareShopContracts.ViewModels
@{
ViewData["Title"] = "Получение списка";
Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
}
<div class="text-center">
<h1 class="display-4">Список сборок</h1>
</div>

View File

@ -0,0 +1,8 @@
@{
ViewData["Title"] = "Основная - Кладовщик";
Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
}
<div class="d-flex justify-content-center">
<img src="../images/logo.png"/>
</div>

View File

@ -0,0 +1,9 @@
@using HardwareShopContracts.ViewModels
@{
ViewData["Title"] = "Заказы";
Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
}
<div>
привет, мы в заказах
</div>

View File

@ -0,0 +1,5 @@
@using HardwareShopContracts.ViewModels
@{
ViewData["Title"] = "Отчет";
Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
}

View File

@ -10,7 +10,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

View File

@ -8,7 +8,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

View File

@ -8,7 +8,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

View File

@ -5,7 +5,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

View File

@ -8,7 +8,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

View File

@ -8,7 +8,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

View File

@ -6,7 +6,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

View File

@ -10,7 +10,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

View File

@ -9,7 +9,7 @@
@section Header { @section Header {
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid"> <div class="container-fluid"><a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Магазин компьютерной техники "Ты ж программист"</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -1,66 +0,0 @@
using HardwareShopContracts.BindingModels;
using HardwareShopContracts.BusinessLogicsContracts;
using Microsoft.AspNetCore.Mvc;
namespace HardwareShopRestApi.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class MainController : Controller
{
private readonly ILogger _logger;
private readonly IPurchaseLogic _purchase;
private readonly IBuildLogic _build;
public MainController(ILogger<MainController> logger, IPurchaseLogic pur, IBuildLogic build)
{
_logger = logger;
_purchase = pur;
_build = build;
}
[HttpPost]
public void CreateBuild(BuildBindingModel model)
{
try
{
_build.Create(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка создания");
throw;
}
}
[HttpPost]
public void CreatePurchase(PurchaseBindingModel model)
{
try
{
_purchase.Create(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка создания");
throw;
}
}
[HttpPut]
public void UpdateBuild(BuildBindingModel model)
{
try
{
_build.Update(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка обновления");
throw;
}
}
}
}