Наделал страниц сущностей. Осталось для авто #11

Merged
mallafeev merged 10 commits from storekeeperApp into main 2024-04-30 17:08:35 +04:00
8 changed files with 230 additions and 6 deletions
Showing only changes of commit cfe9994b25 - Show all commits

View File

@ -28,7 +28,27 @@ namespace CarCenterStorekeeperApp.Controllers
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[HttpGet]
public IActionResult Bundlings()
{
return View();
}
[HttpGet]
public IActionResult BundlingCreate()
{
return View();
}
[HttpGet]
public IActionResult BundlingDelete()
{
return View();
}
[HttpGet]
public IActionResult BundlingUpdate()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });

View File

@ -0,0 +1,53 @@
@using CarCenterContracts.ViewModels;
@using CarCenterDataModels.Enums;
@{
ViewData["Title"] = "CreateBundling";
}
<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 name="equipmentPackage" id="equipmentPackage">
@foreach (var value in Enum.GetValues(typeof(EquipmentPackage)))
{
<option value="@value">@value</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-4">Пакет шин:</div>
<div class="col-8">
<select name="tirePackage" id="tirePackage">
@foreach (var value in Enum.GetValues(typeof(TirePackage)))
{
<option value="@value">@value</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-4">Пакет инструментов:</div>
<div class="col-8">
<select name="toolKit" id="toolKit">
@foreach (var value in Enum.GetValues(typeof(ToolKit)))
{
<option value="@value">@value</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-4">Цена:</div>
<div class="col-8"><input type="text" name="price" id="price" /></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

@ -0,0 +1,16 @@
@{
ViewData["Title"] = "BundlingDelete";
}
<div class="text-center">
<h2 class="display-4">Удалить комплектацию</h2>
</div>
<form method="post">
<div class="row">
<div class="col-8">
<select id="bundling" name="bundling" class="form-control" asp-items="@(new SelectList(@ViewBag.Bundlings,"Id"))"></select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Удалить" class="btn btn-danger" />
</div>
</form>

View File

@ -0,0 +1,59 @@
@using CarCenterDataModels.Enums;
@{
ViewData["Title"] = "BundlingUpdate";
}
<div class="text-center">
<h2 class="display-4 mb-5">Обновить комплектацию</h2>
</div>
<form method="post">
<div class="row mb-3">
<div class="col-4">Комплектация:</div>
<div class="col-8">
<select id="bundling" name="bundling" class="form-control" asp-items="@(new SelectList(@ViewBag.Bundlings,"Id"))"></select>
</div>
</div>
<div class="row">
<div class="col-4">Пакет оборудования:</div>
<div class="col-8">
<select name="equipmentPackage" id="equipmentPackage">
@foreach (var value in Enum.GetValues(typeof(EquipmentPackage)))
{
<option value="@value">@value</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-4">Пакет шин:</div>
<div class="col-8">
<select name="tirePackage" id="tirePackage">
@foreach (var value in Enum.GetValues(typeof(TirePackage)))
{
<option value="@value">@value</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-4">Пакет инструментов:</div>
<div class="col-8">
<select name="toolKit" id="toolKit">
@foreach (var value in Enum.GetValues(typeof(ToolKit)))
{
<option value="@value">@value</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-4">Цена:</div>
<div class="col-8"><input type="text" name="price" id="price" /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
</div>
<div class="text-center ">
<input type="submit" value="Обновить" class="btn btn-success ps-5 pe-5" />
</div>
</form>

View File

@ -0,0 +1,60 @@
@using CarCenterContracts.ViewModels;
@model List<BundlingViewModel>
@{
ViewData["Title"] = "Bundlings";
}
<div class="text-center">
<h1 class="display-4">Комплектации</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h2 class="display-4">Надо войти в аккаунт.</h2>
return;
}
<p>
<a class="text-decoration-none me-3 text-black h5" asp-action="Create">Создать комлпектацию</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="Update">Изменить комплектацию</a>
<a class="text-decoration-none text-black h5" asp-action="Delete">Удалить комплектацию</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Пакет оборудования
</th>
<th>
Пакет шин
</th>
<th>
Пакет инструментов
</th>
<th>
Цена
</th>
</tr>
</thead>
<tbody>
@foreach (var bundling in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => bundling.EquipmentPackage)
</td>
<td>
@Html.DisplayFor(modelItem => bundling.TirePackage)
</td>
<td>
@Html.DisplayFor(modelItem => bundling.ToolKit)
</td>
<td>
@Html.DisplayFor(modelItem => bundling.Price)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -6,8 +6,8 @@
</div>
<form method="post">
<div class="row">
<div class="col-4">Логин:</div>
<div class="col-8"><input type="text" name="login" /></div>
<div class="col-4">Логин(почта):</div>
<div class="col-8"><input type="email" name="email" /></div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>

View File

@ -6,15 +6,28 @@
</div>
<form method="post">
<div class="row">
<div class="col-4">Логин:</div>
<div class="col-8"><input type="text" name="login" /></div>
<div class="col-4">Имя:</div>
<div class="col-8"><input type="text" name="name" /></div>
</div>
<div class="row">
<div class="col-4">Фамилия:</div>
<div class="col-8"><input type="text" name="surname" /></div>
</div>
<div class="row">
<div class="col-4">Отчество:</div>
<div class="col-8"><input type="text" name="patronymic" /></div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>
<div class="col-8"><input type="password" name="password" /></div>
</div>
<div class="row">
<div class="col-4">Имя:</div><div class="col-8"><input type="text" name="name" /></div>
<div class="col-4">Почта:</div>
<div class="col-8"><input type="email" name="email" /></div>
</div>
<div class="row">
<div class="col-4">Номер телефона:</div>
<div class="col-8"><input type="text" name="phone" /></div>
</div>
<div class="row">
<div class="col-8"></div>

View File

@ -28,6 +28,9 @@
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Bundlings">Комплектации</a>
</li>
</ul>
</div>
</div>