Create views for client app

This commit is contained in:
Zakharov_Rostislav 2024-05-12 16:54:11 +04:00
parent c24ef8e895
commit aa93c93775
9 changed files with 289 additions and 12 deletions

View File

@ -0,0 +1,24 @@
@{
ViewData["Title"] = "ClientCreate";
}
<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"><input type="text" name="phonenumber" /></div>
</div>
<div class="row">
<div class="col-4">ФИО:</div>
<div class="col-8"><input type="text" name="name" /></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,47 @@
@using CarShowroomDataModels.Views
@{
ViewData["Title"] = "ClientUpdate";
}
<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"><input type="text" name="phonenumber" /></div>
</div>
<div class="row">
<div class="col-4">ФИО:</div>
<div class="col-8"><input type="text" name="name" /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="C"
class="btn btn-primary" />
</div>
</div>
</form>
@section Scripts
{
<script>
function check() {
var client = $('#client').val();
if (client) {
$.ajax({
method: "GET",
url: "/Home/GetClient",
data: { clientId: client },
success: function (result) {
$('#number').val(result.item1.number);
}
});
};
}
check();
$('#client').on('change', function () {
check();
});
</script>
}

View File

@ -0,0 +1,49 @@
@using CarShowroomDataModels.Views
@model List<ClientView>
@{
ViewData["Title"] = "Clients";
}
<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-action="ClientCreate">Создать перевод</a>
<a asp-action="ClientUpdate">Обновить перевод</a>
</p>
<table class="table">
<thead>
<tr>
<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.Name)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.PhoneNumber)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -0,0 +1,20 @@
@{
ViewData["Title"] = "Enter";
}
<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"><input type="text" name="login" /></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-8"></div>
<div class="col-4"><input type="submit" value="Вход" class="btn btn-primary" /></div>
</div>
</form>

View File

@ -1,8 +1,54 @@
@{ @using CarShowroomDataModels.Views
ViewData["Title"] = "Home Page"; @model List<SaleView>
@{
ViewData["Title"] = "Sales";
} }
<div class="text-center"> <div class="text-center">
<h1 class="display-4">Welcome</h1> <h1 class="display-4">Продажи</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p> </div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a asp-action="SaleCreate">Создать продажу</a>
<a asp-action="SaleDelete">Удалить продажу</a>
</p>
<table class="table">
<thead>
<tr>
<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.Cost)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.EmployeeName)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.ClientName)
</td>
</tr>
}
</tbody>
</table>
}
</div> </div>

View File

@ -1,6 +1,31 @@
@{ @using CarShowroomDataModels.Views
@model EmployeeView
@{
ViewData["Title"] = "Privacy Policy"; ViewData["Title"] = "Privacy Policy";
} }
<h1>@ViewData["Title"]</h1> <div class="text-center">
<h2 class="display-4">Личные данные</h2>
<p>Use this page to detail your site's privacy policy.</p> </div>
<form method="post">
<div class="row">
<div class="col-4">Логин:</div>
<div class="col-8">
<input type="text" name="login"
value="@Model.Email" />
</div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>
<div class="col-8">
<input type="password" name="password"
value="@Model.Password" />
</div>
</div>
<div class="row">
<div class="col-4">ФИО:</div>
<div class="col-8">
<input type="text" name="fio"
value="@Model.Name" />
</div>
</div>
</form>

View File

@ -0,0 +1,42 @@
@{
ViewData["Title"] = "SaleCreate";
}
<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">
<input type="number" name="sum" id="sum" readonly/>
</div>
</div>
<div class="row">
<div class="col-4">Автомобили:</div>
<div class="col-8">
<select name="cars" id="cars" class="form-control" multiple size="5">
@foreach (var car in ViewBag.Cars)
{
<option value="@car.Id">@car.Name</option>
}
</select>
</div>
</div>
<div class="row">
<div class="col-4">Услуги:</div>
<div class="col-8">
<select name="services" id="services" class="form-control" multiple size="5">
@foreach (var service in ViewBag.Services)
{
<option value="@service.Id">@service.Name</option>
}
</select>
</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,18 @@
@{
ViewData["Title"] = "SaleDelete";
}
<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="sale" name="sale" class="form-control" asp-items="@(new SelectList(@ViewBag.Sales, "Id", "Id"))"></select>
</div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col-8"><input type="submit" value="Удалить" class="btn btn-danger" /></div>
</div>
</form>

View File

@ -20,10 +20,16 @@
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between"> <div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1"> <ul class="navbar-nav flex-grow-1">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a> <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a> <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Продажи</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Clients">Клиенты</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личный кабинет</a>
</li> </li>
</ul> </ul>
</div> </div>