1 Commits

Author SHA1 Message Date
b8753069d7 сайт 2024-05-01 19:43:56 +04:00
57 changed files with 825 additions and 950 deletions

View File

@@ -15,7 +15,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerHardwareStoreDataba
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputerHardwareStoreREST", "ComputerHardwareStoreREST\ComputerHardwareStoreREST.csproj", "{20E4D287-C0F4-4DAB-B338-349F8B6EA22B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VendorClient", "VendorClient\VendorClient.csproj", "{BD0D9FB9-7F73-4011-AAC8-D5508EC5EB53}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StoreKeeperClient", "ComputerHardwareStoreStoreKeeperApp\StoreKeeperClient.csproj", "{0FF8FE3D-A38E-40AF-9286-4D7B11ADA785}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -47,10 +47,10 @@ Global
{20E4D287-C0F4-4DAB-B338-349F8B6EA22B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20E4D287-C0F4-4DAB-B338-349F8B6EA22B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20E4D287-C0F4-4DAB-B338-349F8B6EA22B}.Release|Any CPU.Build.0 = Release|Any CPU
{BD0D9FB9-7F73-4011-AAC8-D5508EC5EB53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD0D9FB9-7F73-4011-AAC8-D5508EC5EB53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD0D9FB9-7F73-4011-AAC8-D5508EC5EB53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD0D9FB9-7F73-4011-AAC8-D5508EC5EB53}.Release|Any CPU.Build.0 = Release|Any CPU
{0FF8FE3D-A38E-40AF-9286-4D7B11ADA785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0FF8FE3D-A38E-40AF-9286-4D7B11ADA785}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0FF8FE3D-A38E-40AF-9286-4D7B11ADA785}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0FF8FE3D-A38E-40AF-9286-4D7B11ADA785}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -0,0 +1,6 @@
@ComputerHardwareStoreStoreKeeperApp_HostAddress = http://localhost:5062
GET {{ComputerHardwareStoreStoreKeeperApp_HostAddress}}/weatherforecast/
Accept: application/json
###

View File

@@ -0,0 +1,49 @@
using ComputerHardwareStoreContracts.BusinessLogicsContracts;
using ComputerHardwareStoreContracts.StorageContracts;
using ComputerHardwareStoreDatabaseImplement.Implements;
using ComputerHardwareStoreBusinessLogic.BusinessLogic;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Logging.SetMinimumLevel(LogLevel.Trace);
builder.Services.AddTransient<IVendorStorage, VendorStorage>();
builder.Services.AddTransient<IPurchaseStorage, PurchaseStorage>();
builder.Services.AddTransient<IBuildStorage, BuildStorage>();
builder.Services.AddTransient<ICommentStorage, CommentStorage>();
builder.Services.AddTransient<IProductStorage, ProductStorage>();
builder.Services.AddTransient<IComponentStorage, ComponentStorage>();
builder.Services.AddTransient<IStoreKeeperStorage, StoreKeeperStorage>();
builder.Services.AddTransient<IVendorLogic, VendorLogic>();
builder.Services.AddTransient<IPurchaseLogic, PurchaseLogic>();
builder.Services.AddTransient<IBuildLogic, BuildLogic>();
builder.Services.AddTransient<ICommentLogic, CommentLogic>();
builder.Services.AddTransient<IProductLogic, ProductLogic>();
builder.Services.AddTransient<IComponentLogic, ComponentLogic>();
builder.Services.AddTransient<IStoreKeeperLogic, StoreKeeperLogic>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();

View File

@@ -4,8 +4,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:27793",
"sslPort": 44393
"applicationUrl": "http://localhost:34433",
"sslPort": 44361
}
},
"profiles": {
@@ -14,7 +14,7 @@
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5194",
"applicationUrl": "http://localhost:5062",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
@@ -24,7 +24,7 @@
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7085;http://localhost:5194",
"applicationUrl": "https://localhost:7291;http://localhost:5062",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

View File

@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ComputerHardwareStoreBusinessLogic\ComputerHardwareStoreBusinessLogic.csproj" />
<ProjectReference Include="..\ComputerHardwareStoreContracts\ComputerHardwareStoreContracts.csproj" />
<ProjectReference Include="..\ComputerHardwareStoreDatabaseImplement\ComputerHardwareStoreDatabaseImplement.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,53 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<ProductViewModel>
@{
ViewData["Title"] = "BuildsByProductsReport";
}
<div class="text-center">
<h1 class="display-4">Сборки по товарам</h1>
</div>
<div class="text-center">
<form method="post">
@{
if (Model == null)
{
<h3 class="display-4">Войдите в профиль</h3>
return;
}
<div class="row mb-5">
<div class="col-4">Формат сохранения:</div>
<div class="col-8">
<input type="radio" id="xlc" name="saveFormat" value="xlc">
<label for="xlc">XLC</label>
<input type="radio" id="doc" name="saveFormat" value="doc">
<label for="doc">DOC</label>
</div>
</div>
<div class="row mb-5">
<div class="col-4">Выберите файл:</div>
<div class="col-8">
<input type="file" id="fileSave" name="fileSave" style="display:none">
<button type="button" onclick="document.getElementById('fileSave').click();">Выбрать файл</button>
</div>
</div>
<div class="row mb-5">
<div class="col-4">Выберите товары:</div>
<div class="col-8">
<select name="products" multiple>
@foreach (var product in Model)
{
<option value="@product.Id">@product.Name</option>
}
</select>
</div>
</div>
<div class="row mb-5">
<div class="col-8">
</div>
<div class="col-4">
<input type="submit" value="Сохранить список" class="btn btn-success" />
</div>
</div>
}
</form>
</div>

View File

@@ -1,20 +1,20 @@
@{
ViewData["Title"] = "AddBuildToPurchase";
ViewData["Title"] = "ComponentToBuild";
}
<div class="text-center mb-5">
<h2 class="display-4">Добавить сборку в покупку</h2>
<h2 class="display-4">Добавить комплектующие в сборку</h2>
</div>
<form method="post">
<div class="row mb-5">
<div class="col-4">Покупка:</div>
<div class="col-4">Сборка:</div>
<div class="col-8 ">
<select id="purchaseId" name="purchaseId" class="form-control" asp-items="@(new SelectList(@ViewBag.Purchases,"Id", "Date"))"></select>
<select id="buildId" name="buildId" class="form-control" asp-items="@(new SelectList(@ViewBag.Purchases,"Id", "BuildName"))"></select>
</div>
</div>
<div class="row mb-5">
<div class="col-4">Сборка:</div>
<div class="col-4">Комплектующее:</div>
<div class="col-8">
<select id="productId" name="productId" class="form-control" asp-items="@(new SelectList(@ViewBag.Products,"Id", "ProductName"))"></select>
<select id="componentId" name="componentId" class="form-control" asp-items="@(new SelectList(@ViewBag.Products,"Id", "ComponentName"))"></select>
</div>
</div>
<div class="row mb-5">
@@ -26,4 +26,4 @@
<div class="col-4">
<input type="submit" value="Добавить" class="btn btn-success" />
</div>
</form>
</form>

View File

@@ -0,0 +1,58 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<ComponentViewModel>
@{
ViewData["Title"] = "Components";
}
<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 class="text-decoration-none me-3 text-black h5" asp-action="CreateComponent">Создать комплектующее</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="UpdateComponent">Изменить комплектующее</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="ComponentToBuild">Привязать комплектующее к сборке</a>
<a class="text-decoration-none text-black h5" asp-action="DeleteComponent">Удалить комплектующее</a>
</p>
<table class="componentTable">
<thead>
<tr>
<th>
Номер
</th>
<th>
Название
</th>
<th>
Цена
</th>
</tr>
</thead>
<tbody>
<tbody>
@foreach (var component in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => component.Id)
</td>
<td>
@Html.DisplayFor(modelItem => component.ComponentName)
</td>
<td>
@Html.DisplayFor(modelItem => component.ComponentPrice)
</td>
</tr>
}
</tbody>
</tbody>
</table>
}
</div>

View File

@@ -0,0 +1,58 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<ComponentViewModel>
@{
ViewData["Title"] = "ComponentsByPurchasesAndOrdersReport";
}
<div class="text-center">
<h1 class="display-4">Отчёт по комплектующим</h1>
</div>
<div class="text-center">
<form method="post">
@{
if (Model == null)
{
<h3 class="display-4">Войдите в профиль</h3>
return;
}
<div class="row mb-5">
<div class="col-4">Формат получения:</div>
<div class="col-8">
<input type="radio" id="email" name="saveFormat" value="email">
<label for="email">почта</label>
<input type="radio" id="site" name="saveFormat" value="site">
<label for="site">на сайте</label>
</div>
</div>
<div class="row mb-5">
<div class="col-4">Начальная дата:</div>
<div class="col-8">
<input type="date" id="startDate" name="startDate" class="form-control">
</div>
</div>
<div class="row mb-5">
<div class="col-4">Конечная дата:</div>
<div class="col-8">
<input type="date" id="endDate" name="endDate" class="form-control">
</div>
</div>
<div class="row mb-5">
<div class="col-4">Выберите комплектующие:</div>
<div class="col-8">
<select name="components" multiple>
@foreach (var component in Model)
{
<option value="@component.Id">@component.Id @component.Name</option>
}
</select>
</div>
</div>
<div class="row mb-5">
<div class="col-8">
</div>
<div class="col-4">
<input type="submit" value="получить отчёт" class="btn btn-success" />
</div>
</div>
}
</form>
</div>

View File

@@ -1,17 +1,18 @@
@{
ViewData["Title"] = "BuildCreate";
ViewData["Title"] = "CreateComponent";
}
<div class="text-center">
<h2 class="display-4 mb-5">Создать сборку</h2>
<h2 class="display-4 mb-5">Создать комплектующее</h2>
</div>
<form method="post">
<div class="row mb-5">
<div class="col-4">Название:</div>
<div class="col-8"><input type="number" id="name" name="name" /></div>
<div class="col-8"><input type="text" id="componentName" name="componentName" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Цена:</div>
<div class="col-8"><input type="text" id="cost" name="cost" /></div>
<div class="col-8"><input type="number" id="componentPrice" name="componentPrice" /></div>
</div>
<div class="row mb-5">
<div class="col-8">
@@ -20,4 +21,5 @@
<input type="submit" value="Создать" class="btn btn-success" />
</div>
</div>
</form>

View File

@@ -0,0 +1,29 @@
@{
ViewData["Title"] = "CreateOrder";
}
<div class="text-center">
<h2 class="display-4 mb-5">Создать заказ</h2>
</div>
<form method="post">
<div class="row mb-5">
<div class="col-4">Дата:</div>
<div class="col-8"><input type="number" id="date" name="date" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Адрес доставки:</div>
<div class="col-8"><input type="text" id="address" name="address" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Товар:</div>
<div class="col-8">
<select id="product" name="product" class="form-control" asp-items="@(new SelectList(@ViewBag.Products,"Id", "ProductName"))"></select>
</div>
</div>
<div class="row mb-5">
<div class="col-8">
</div>
<div class="col-4">
<input type="submit" value="Создать" class="btn btn-success" />
</div>
</div>
</form>

View File

@@ -0,0 +1,36 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<ComponentViewModel>
@{
ViewData["Title"] = "CreateProduct";
}
<div class="text-center">
<h2 class="display-4 mb-5">Создать товар</h2>
</div>
<form method="post">
<div class="row mb-5">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" id="productName" name="productName" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Цена:</div>
<div class="col-8"><input type="number" id="productPrice" name="productPrice" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Комплектующие:</div>
<div class="col-8">
<select name="components" multiple>
@foreach (var component in Model)
{
<option value="@component.Id">@component.Name</option>
}
</select>
</div>
</div>
<div class="row mb-5">
<div class="col-8">
</div>
<div class="col-4">
<input type="submit" value="Создать" class="btn btn-success" />
</div>
</div>
</form>

View File

@@ -0,0 +1,17 @@
@{
ViewData["Title"] = "DeleteComponent";
}
<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="component" name="component" class="form-control" asp-items="@(new SelectList(@ViewBag.Components,"Id", "Name"))"></select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Удалить" class="btn btn-danger" />
</div>
</form>

View File

@@ -0,0 +1,17 @@
@{
ViewData["Title"] = "DeleteOrder";
}
<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="order" name="order" class="form-control" asp-items="@(new SelectList(@ViewBag.Orders,"Id", "DateCreate"))"></select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Удалить" class="btn btn-danger" />
</div>
</form>

View File

@@ -0,0 +1,17 @@
@{
ViewData["Title"] = "DeleteProduct";
}
<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="product" name="product" class="form-control" asp-items="@(new SelectList(@ViewBag.Products,"Id", "Name"))"></select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Удалить" class="btn btn-danger" />
</div>
</form>

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 btnprimary" /></div>
</div>
</form>

View File

@@ -3,5 +3,5 @@
}
<div class="text-center">
<img src="./Images/Logo.jpg" alt="logo">
<img src="./Images/Logo.jpg" alt="logo" />
</div>

View File

@@ -0,0 +1,57 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<OrderForProductsViewModel>
@{
ViewData["Title"] = "Orders";
}
<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 class="text-decoration-none me-3 text-black h5" asp-action="CreateOrder">Создать заказ</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="UpdateOrder">Изменить заказ</a>
<a class="text-decoration-none text-black h5" asp-action="DeleteOrder">Удалить заказе</a>
</p>
<table class="OrderTable">
<thead>
<tr>
<th>
Номер
</th>
<th>
Дата создания
</th>
<th>
Дата выполнения
</th>
</tr>
</thead>
<tbody>
<tbody>
@foreach (var order in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => order.Id)
</td>
<td>
@Html.DisplayFor(modelItem => order.DateCreate)
</td>
<td>
@Html.DisplayFor(modelItem => order.DateImplemet)
</td>
</tr>
}
</tbody>
</tbody>
</table>
}
</div>

View File

@@ -0,0 +1,58 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<ProductViewModel>
@{
ViewData["Title"] = "Products";
}
<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 class="text-decoration-none me-3 text-black h5" asp-action="CreateProduct">Создать товар</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="UpdateProduct">Изменить товар</a>
<a class="text-decoration-none text-black h5" asp-action="DeleteProduct">Удалить товар</a>
</p>
<table class="productTable">
<thead>
<tr>
<th>
Номер
</th>
<th>
Название
</th>
<th>
Цена
</th>
</tr>
</thead>
<tbody>
<tbody>
@foreach (var Product in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => Product.Id)
</td>
<td>
@Html.DisplayFor(modelItem => Product.Name)
</td>
<td>
@Html.DisplayFor(modelItem => Product.Price)
</td>
</tr>
}
</tbody>
</tbody>
</table>
}
</div>

View File

@@ -0,0 +1,25 @@
@{
ViewData["Title"] = "Register";
}
<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="storeKeeperName" /></div>
</div>
<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

@@ -0,0 +1,52 @@
@{
ViewData["Title"] = "UpdateComponent";
}
<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="component" name="component" class="form-control" asp-items="@(new SelectList(@ViewBag.Components,"Id", "ComponentName"))"></select>
</div>
</div>
<div class="row mb-3">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" id="componentName" name="componentName" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Цена:</div>
<div class="col-8"><input type="number" id="componentPrice" name="componentPrice" /></div>
</div>
<div class="text-center ">
<input type="submit" value="Обновить" class="btn btn-success ps-5 pe-5" />
</div>
</form>
<<script>
$('#component').on('change', function () {
getData();
});
function getData() {
var componentId = $('#component').val();
var componentData = @Html.Raw(Json.Serialize(ViewBag.Components));
var selectedComponent = componentData.find(function (component) {
return component.id == componentId;
});
if (selectedComponent) {
$("#componentName").val(selectedComponent.componentName);
$("#omponentPrice").val(selectedComponent.componentPrice);
fillTableBuilds(selectedComponent.buildsAndCounts);
}
function fillTableBuilds(componentBuilds) {
$("#componentTableBuilds").empty();
for (var build in componentBuilds)
$("#componentTableBuilds").append('<tr><td>' + componentBuilds[build].item1 + '</td><td>' + componentBuilds[build].item2 + '</td></tr>');
}
}
</script>

View File

@@ -0,0 +1,46 @@
@{
ViewData["Title"] = "UpdateOrder";
}
<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="order" name="order" class="form-control" asp-items="@(new SelectList(@ViewBag.OrdersForProducts,"Id", "OrderDate"))"></select>
</div>
</div>
<div class="row mb-3">
<div class="col-4">Дата:</div>
<div class="col-8"><input type="date" id="date" name="date" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Товар:</div>
<div class="col-8">
<select id="product" name="product" class="form-control" asp-items="@(new SelectList(@ViewBag.Orders,"Id", "OrderName"))"></select>
</div>
</div>
<div class="text-center ">
<input type="submit" value="Обновить" class="btn btn-success ps-5 pe-5" />
</div>
</form>
<<script>
$('#order').on('change', function () {
getData();
});
function getData() {
var orderId = $('#order').val();
var orderData = @Html.Raw(Json.Serialize(ViewBag.Orders));
var selectedOrder = orderData.find(function (order) {
return order.id == orderId;
});
if (selectedOrder) {
$("#date").val(selectedOrder.date);
$("#product").val(selectedOrder.orderId).change();
}
}
</script>

View File

@@ -0,0 +1,69 @@
@{
ViewData["Title"] = "UpdateProduct";
}
<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="product" name="product" class="form-control" asp-items="@(new SelectList(@ViewBag.Products,"Id", "ProductName"))"></select>
</div>
</div>
<div class="row mb-3">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" id="productName" name="productName" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Цена:</div>
<div class="col-8"><input type="number" id="productPrice" name="productPrice" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Комплектующие в товаре:</div>
<div class="col-8">
<table class="tableComponents">
<thead>
<tr>
<th>Название</th>
<th>Количество</th>
</tr>
</thead>
<tbody id="productTableComponents">
</tbody>
</table>
</div>
</div>
<div class="text-center ">
<input type="submit" value="Обновить" class="btn btn-success ps-5 pe-5" />
</div>
</form>
<<script>
$('#product').on('change', function () {
getData();
});
function getData() {
var productId = $('#product').val();
var productData = @Html.Raw(Json.Serialize(ViewBag.Products));
var selectedProduct = productData.find(function (product) {
return product.id == productId;
});
if (selectedproduct) {
$("#productName").val(selectedProduct.productName);
$("#productPrice").val(selectedProduct.productPrice);
fillTableComponents(selectedProduct.componentsAndCounts);
}
}
function fillTableComponents(productComponents) {
$("#productTableComponents").empty();
for (var component in productComponents)
$("#productTableComponents").append('<tr><td>' + productComponents[component].item1 + '</td><td>' +productComponents[component].item2 + '</td></tr>');
}
</script>

View File

@@ -1,143 +0,0 @@
using ComputerHardwareStoreContracts.ViewModels;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using VendorClient.Models;
namespace VendorClient.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
[HttpGet]
public IActionResult Index()
{
return View();
}
[HttpGet]
public IActionResult Privacy()
{
return View();
}
[HttpGet]
public IActionResult Enter()
{
return View();
}
[HttpGet]
public IActionResult Register()
{
return View();
}
[HttpGet]
public IActionResult AddBuildToPurchase()
{
return View();
}
[HttpGet]
public IActionResult Builds()
{
return View(new List<BuildViewModel>());
}
[HttpGet]
public IActionResult BuildCreate()
{
return View();
}
[HttpGet]
public IActionResult BuildDelete()
{
return View();
}
[HttpGet]
public IActionResult BuildUpdate()
{
return View();
}
[HttpGet]
public IActionResult CommentCreate()
{
return View();
}
[HttpGet]
public IActionResult CommentDelete()
{
return View();
}
[HttpGet]
public IActionResult CommentUpdate()
{
return View();
}
[HttpGet]
public IActionResult Comments()
{
return View(new List<CommentViewModel>());
}
[HttpGet]
public IActionResult ProductsList()
{
return View(new List<BuildViewModel>());
}
[HttpGet]
public IActionResult PurchaseCreate()
{
return View();
}
[HttpGet]
public IActionResult PurchaseDelete()
{
return View();
}
[HttpGet]
public IActionResult Purchases()
{
return View(new List<PurchaseViewModel>());
}
[HttpGet]
public IActionResult PurchaseUpdate()
{
return View();
}
[HttpGet]
public IActionResult Report()
{
return View(new List<PurchaseViewModel>());
}
[HttpPost]
public void Report(string password)
{
Response.Redirect("ReportOnly");
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}

View File

@@ -1,9 +0,0 @@
namespace VendorClient.Models
{
public class ErrorViewModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}

View File

@@ -1,6 +0,0 @@
@VendorClient_HostAddress = http://localhost:5194
GET {{VendorClient_HostAddress}}/weatherforecast/
Accept: application/json
###

View File

@@ -1,17 +0,0 @@
@{
ViewData["Title"] = "BuildDelete";
}
<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="build" name="build" class="form-control" asp-items="@(new SelectList(@ViewBag.Builds,"Id", "Name"))"></select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Удалить" class="btn btn-danger" />
</div>
</form>

View File

@@ -1,44 +0,0 @@
@{
ViewData["Title"] = "BuildUpdate";
}
<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="build" name="build" class="form-control" asp-items="@(new SelectList(@ViewBag.Builds,"Id", "Name"))"></select>
</div>
</div>
<div class="row mb-3">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" id="name" name="name" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Цена:</div>
<div class="col-8"><input type="number" id="cost" name="cost" /></div>
</div>
<div class="text-center ">
<input type="submit" value="Обновить" class="btn btn-success ps-5 pe-5" />
</div>
</form>
<<script>
$('#build').on('change', function () {
getData();
});
function getData() {
var buildId = $('#build').val();
var buildData = @Html.Raw(Json.Serialize(ViewBag.Builds));
var selectedBuild = buildData.find(function (build) {
return build.id == buildId;
});
if (selectedBuild) {
$("#text").val(selectedBuild.address);
$("#cost").val(selectedBuild.cost);
}
}
</script>

View File

@@ -1,54 +0,0 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<BuildViewModel>
@{
ViewData["Title"] = "Builds";
}
<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 class="text-decoration-none me-3 text-black h5" asp-action="BuildCreate">Создать сборку</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="BuildUpdate">Изменить сборку</a>
<a class="text-decoration-none text-black h5" asp-action="BuildDelete">Удаление магазина</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Название
</th>
<th>
Цена
</th>
</tr>
</thead>
<tbody>
@foreach (var build in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => build.Id)
</td>
<td>
@Html.DisplayFor(modelItem => build.Name)
</td>
<td>
@Html.DisplayFor(modelItem => build.Price)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@@ -1,29 +0,0 @@
@{
ViewData["Title"] = "CommentCreate";
}
<div class="text-center">
<h2 class="display-4 mb-5">Создать комментарий</h2>
</div>
<form method="post">
<div class="row mb-5">
<div class="col-4">Заголовок:</div>
<div class="col-8"><input type="number" id="title" name="title" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Текст:</div>
<div class="col-8"><input type="text" id="text" name="text" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Сборка:</div>
<div class="col-8">
<select id="build" name="build" class="form-control" asp-items="@(new SelectList(@ViewBag.Builds,"Id", "Name"))"></select>
</div>
</div>
<div class="row mb-5">
<div class="col-8">
</div>
<div class="col-4">
<input type="submit" value="Создать" class="btn btn-success" />
</div>
</div>
</form>

View File

@@ -1,17 +0,0 @@
@{
ViewData["Title"] = "CommentDelete";
}
<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="comment" name="comment" class="form-control" asp-items="@(new SelectList(@ViewBag.Comments,"Id", "Text"))"></select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Удалить" class="btn btn-danger" />
</div>
</form>

View File

@@ -1,52 +0,0 @@
@{
ViewData["Title"] = "CommentUpdate";
}
<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="comment" name="comment" class="form-control" asp-items="@(new SelectList(@ViewBag.Comments,"Id", "Text"))"></select>
</div>
</div>
<div class="row mb-3">
<div class="col-4">Заголовок:</div>
<div class="col-8"><input type="text" id="title" name="title" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Текст:</div>
<div class="col-8"><input type="text" id="text" name="text" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Сборка:</div>
<div class="col-8">
<select id="build" name="build" class="form-control" asp-items="@(new SelectList(@ViewBag.Builds,"Id", "Name"))"></select>
</div>
</div>
<div class="text-center ">
<input type="submit" value="Обновить" class="btn btn-success ps-5 pe-5" />
</div>
</form>
<<script>
$('#comment').on('change', function () {
getData();
});
function getData() {
var commentId = $('#comment').val();
var commentData = @Html.Raw(Json.Serialize(ViewBag.Comments));
var selectedComment = commentData.find(function (comment) {
return comment.id == commentId;
});
if (selectedComment) {
$("#title").val(selectedComment.title);
$("#text").val(selectedComment.text);
$("#build").val(selectedComment.buildId).change(); // <!-- в работоспособности не уверен -->
}
}
</script>

View File

@@ -1,51 +0,0 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<CommentViewModel>
@{
ViewData["Title"] = "Comments";
}
<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 class="text-decoration-none me-3 text-black h5" asp-action="CommentCreate">Создать комментарий</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="CommentUpdate">изменить коммментарий</a>
<a class="text-decoration-none text-black h5" asp-action="CommentDelete">Удалить комментарий</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Заголовок
</th>
<th>
Текст
</th>
</tr>
</thead>
<tbody>
@foreach (var comment in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => comment.Id)
</td>
<td>
@Html.DisplayFor(modelItem => comment.Text)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@@ -1,20 +0,0 @@
@{
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 btnprimary" /></div>
</div>
</form>

View File

@@ -1,53 +0,0 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<BuildViewModel>
@{
ViewData["Title"] = "ProductsList";
}
<div class="text-center">
<h1 class="display-4">Товары по сборкам</h1>
</div>
<div class="text-center">
<form method="post">
@{
if (Model == null)
{
<h3 class="display-4">Войдите!</h3>
return;
}
<div class="row mb-5">
<div class="col-4">Формат сохранения:</div>
<div class="col-8">
<input type="radio" id="xlc" name="saveFormat" value="xlc">
<label for="xlc">XLC</label>
<input type="radio" id="doc" name="saveFormat" value="doc">
<label for="doc">DOC</label>
</div>
</div>
<div class="row mb-5">
<div class="col-4">Выберите файл:</div>
<div class="col-8">
<input type="file" id="fileSave" name="fileSave" style="display:none">
<button type="button" onclick="document.getElementById('fileSave').click();">Выбрать файл</button>
</div>
</div>
<div class="row mb-5">
<div class="col-4">Выберите сборки:</div>
<div class="col-8">
<select name="assemblies" multiple>
@foreach (var build in Model)
{
<option value="@build.Id">@build.Name</option>
}
</select>
</div>
</div>
<div class="row mb-5">
<div class="col-8">
</div>
<div class="col-4">
<input type="submit" value="Сохранить список" class="btn btn-success" />
</div>
</div>
}
</form>
</div>

View File

@@ -1,43 +0,0 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<ProductViewModel>
@{
ViewData["Title"] = "PurchaseCreate";
}
<div class="text-center">
<h2 class="display-4 mb-5">Создать покупку</h2>
</div>
<form method="post">
@{
if (Model == null)
{
<h3 class="display-4">Надо войти!</h3>
return;
}
<div class="row mb-5">
<div class="col-4">Сумма:</div>
<div class="col-8"><input type="number" id="summ" name="summ" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Адрес:</div>
<div class="col-8"><input type="text" id="address" name="address" /></div>
</div>
<div class="row mb-5">
<div class="col-4">Товары:</div>
<div class="col-8">
<select name="products" multiple>
@foreach (var product in Model)
{
<option value="@product.Id">@product.Name</option>
}
</select>
</div>
</div>
<div class="row mb-5">
<div class="col-8">
</div>
<div class="col-4">
<input type="submit" value="Создать" class="btn btn-success" />
</div>
</div>
}
</form>

View File

@@ -1,17 +0,0 @@
@{
ViewData["Title"] = "PurchaseDelete";
}
<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="purchase" name="purchase" class="form-control" asp-items="@(new SelectList(@ViewBag.Purchases,"Id", "Data"))"></select>
</div>
</div>
<div class="col-4">
<input type="submit" value="Удалить" class="btn btn-danger" />
</div>
</form>

View File

@@ -1,89 +0,0 @@
@{
ViewData["Title"] = "PurchaseUpdate";
}
<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="purchase" name="purchase" class="form-control" asp-items="@(new SelectList(@ViewBag.Purchases,"Id", "Date"))"></select>
</div>
</div>
<div class="row mb-3">
<div class="col-4">Адрес:</div>
<div class="col-8"><input type="text" id="address" name="address" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Сумма:</div>
<div class="col-8"><input type="number" id="summ" name="summ" /></div>
</div>
<div class="row mb-3">
<div class="col-4">Товары в покупке:</div>
<div class="col-8">
<table class="tableProducts">
<thead>
<tr>
<th>Название</th>
<th>Количество</th>
</tr>
</thead>
<tbody id="purchaseTableProducts">
</tbody>
</table>
</div>
</div>
<div class="row mb-3">
<div class="col-4">Сборки в покупке:</div>
<div class="col-8">
<table class="tableBuilds">
<thead>
<tr>
<th>Название</th>
<th>Количество</th>
</tr>
</thead>
<tbody id="purchaseTableBuilds">
</tbody>
</table>
</div>
</div>
<div class="text-center ">
<input type="submit" value="Обновить" class="btn btn-success ps-5 pe-5" />
</div>
</form>
<<script>
$('#purchase').on('change', function () {
getData();
});
function getData() {
var purchaseId = $('#purchase').val();
var purchaseData = @Html.Raw(Json.Serialize(ViewBag.Purchases));
var selectedPurchase = purchaseData.find(function (purchase) {
return purchase.id == purchaseId;
});
if (selectedPurchase) {
$("#address").val(selectedPurchase.address);
$("#summ").val(selectedPurchase.maxCountCars);
fillTableProducts(selectedPurchase.productsAndCounts);
fillTableBuilds(selectedPurchase.assembliesAndCounts);
}
}
function fillTableProducts(purchaseProducts) {
$("#purchaseTableProducts").empty();
for (var product in purchaseProducts)
$("#purchaseTableProducts").append('<tr><td>' + purchaseProducts[product].item1 + '</td><td>' + purchaseProducts[product].item2 + '</td></tr>');
}
function fillTableBuilds(purchaseBuilds) {
$("#purchaseTableBuilds").empty();
for (var build in purchaseBuilds)
$("#purchaseTableBuilds").append('<tr><td>' + purchaseBuilds[build].item1 + '</td><td>' + purchaseBuilds[build].item2 + '</td></tr>');
}
</script>

View File

@@ -1,62 +0,0 @@
@using ComputerHardwareStoreContracts.ViewModels
@model List<PurchaseViewModel>
@{
ViewData["Title"] = "Purchases";
}
<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 class="text-decoration-none me-3 text-black h5" asp-action="PurchaseCreate">Создать покупку</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="PurchaseUpdate">Изменить покупку</a>
<a class="text-decoration-none me-3 text-black h5" asp-action="AddBuildTo">Добавить сборку в покупку</a>
<a class="text-decoration-none text-black h5" asp-action="PurchaseDelete">Удалить покупку</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Дата
</th>
<th>
Сумма
</th>
<th>
Адрес
</th>
</tr>
</thead>
<tbody>
@foreach (var puchase in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => puchase.Id)
</td>
<td>
@Html.DisplayFor(modelItem => puchase.DateCreate)
</td>
<td>
@Html.DisplayFor(modelItem => puchase.Sum)
</td>
<td>
@Html.DisplayFor(modelItem => puchase.DateImplement)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@@ -1,26 +0,0 @@
@{
ViewData["Title"] = "Register";
}
<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-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="Registration"
class="btn btn-primary" />
</div>
</div>
</form>

View File

@@ -1,63 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - AutomobilePlantClientApp</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
<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>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bgwhite border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asparea="" asp-controller="Home" asp-action="Index">Компьтерный магазин "Ты ж программист" </a>
<button class="navbar-toggler" type="button" datatoggle="collapse" data-target=".navbar-collapse" ariacontrols="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-smrow-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Purchases">Покупки</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Builds">Сборки</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Comments">Комментарии</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="ProductsList">Список товаров</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Report">Отчёт</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Вход</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Register">Регистрация</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2024 - Компьютерный магазин
</div>
</footer>
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
</html>

View File

@@ -1,25 +0,0 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>

View File

@@ -1,49 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - ComputerStoreWorkerApp</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="~/ComputerStoreWorkerApp.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">ComputerStoreWorkerApp</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="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2024 - ComputerStoreWorkerApp - <a asp-area="" asp-controller="Home" asp-action="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,48 +0,0 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
a {
color: #0077cc;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px;
}

View File

@@ -1,2 +0,0 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

View File

@@ -1,3 +0,0 @@
@using VendorClient
@using VendorClient.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@@ -1,3 +0,0 @@
@{
Layout = "_Layout";
}

View File

@@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc;
namespace WebApplication1.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}
}

View File

@@ -16,6 +16,8 @@ if (app.Environment.IsDevelopment())
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();

View File

@@ -0,0 +1,41 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:19732",
"sslPort": 44357
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5174",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7272;http://localhost:5174",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,13 @@
namespace WebApplication1
{
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

View File

@@ -10,8 +10,4 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ComputerHardwareStoreContracts\ComputerHardwareStoreContracts.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,6 @@
@WebApplication1_HostAddress = http://localhost:5174
GET {{WebApplication1_HostAddress}}/weatherforecast/
Accept: application/json
###

View File

@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}