Components CRUD

This commit is contained in:
ShabOl 2024-05-29 01:02:20 +04:00
parent fb2938e682
commit 6a5bb257d9
14 changed files with 653 additions and 24 deletions

View File

@ -13,7 +13,7 @@ namespace ComputerShopGuarantorApp
public static void Connect(IConfiguration Configuration) public static void Connect(IConfiguration Configuration)
{ {
_client.BaseAddress = new Uri(Configuration["IPAddress"]); _client.BaseAddress = new Uri(Configuration["IpAddress"]);
_client.DefaultRequestHeaders.Accept.Clear(); _client.DefaultRequestHeaders.Accept.Clear();
_client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
} }

View File

@ -1,5 +1,9 @@
using ComputerShopGuarantorApp.Models; using ComputerShopContracts.BindingModels;
using ComputerShopContracts.ViewModels;
using ComputerShopGuarantorApp.Models;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Hosting;
using System.Diagnostics; using System.Diagnostics;
namespace ComputerShopGuarantorApp.Controllers namespace ComputerShopGuarantorApp.Controllers
@ -15,12 +19,237 @@ namespace ComputerShopGuarantorApp.Controllers
public IActionResult Index() public IActionResult Index()
{ {
if (ApiUser.User == null)
{
return Redirect("~/Home/Enter");
}
return View(); return View();
} }
/*------------------------------------------------------
* Комплектующие
*-----------------------------------------------------*/
public IActionResult Components()
{
if (ApiUser.User == null)
return Redirect("~/Home/Enter");
return View(ApiUser.GetRequest<List<ComponentViewModel>>($"api/component/getcomponents?userId={ApiUser.User.Id}"));
}
/*
[HttpGet]
public ComponentViewModel? GetComponent(int ComponentId)
{
if (ApiUser.User == null)
throw new Exception("Необходима авторизация");
var Result = ApiUser.GetRequest<ComponentViewModel>($"api/component/getcomponent?id={ComponentId}");
if (Result == null)
{
return default;
}
return Result;
}
*/
public IActionResult CreateComponent()
{
return View("Component");
}
[HttpPost]
public void CreateComponent(string ComponentName, double Cost)
{
if (ApiUser.User == null)
throw new Exception("Вход только авторизованным");
ApiUser.PostRequest("api/component/createcomponent", new ComponentBindingModel
{
UserId = ApiUser.User.Id,
ComponentName = ComponentName,
Cost = Cost,
});
Response.Redirect("Components");
}
public IActionResult UpdateComponent(int Id)
{
if (ApiUser.User == null)
return Redirect("~/Home/Enter");
return View("Component", ApiUser.GetRequest<ComponentViewModel>($"api/component/getcomponent?id={Id}"));
}
[HttpPost]
public void UpdateComponent(int Id, string ComponentName, double Cost)
{
if (ApiUser.User == null)
throw new Exception("Вход только авторизованным");
if (Id == 0)
throw new Exception("Комплектующая не указана");
if (string.IsNullOrEmpty(ComponentName))
throw new Exception("Наименование комплектующей не указано");
if (Cost <= 0.0)
throw new Exception("Стоимость должна быть больше нуля");
ApiUser.PostRequest("api/component/updatecomponent", new ComponentBindingModel
{
Id = Id,
UserId = ApiUser.User.Id,
ComponentName = ComponentName,
Cost = Cost,
});
Response.Redirect("../Components");
}
public void DeleteComponent(int Id)
{
ApiUser.PostRequest($"api/component/deletecomponent", new ComponentBindingModel { Id = Id });
Response.Redirect("../Components");
}
/*------------------------------------------------------
* Сборки
*-----------------------------------------------------*/
public IActionResult Assemblies()
{
if (ApiUser.User == null)
return Redirect("~/Home/Enter");
var Assemblies = ApiUser.GetRequest<List<AssemblyViewModel>>($"api/assembly/getassemblies?userId={ApiUser.User.Id}");
return View(Assemblies);
}
/*
[HttpGet]
public AssemblyViewModel? GetAssembly(int AssemblyId)
{
if (ApiUser.User == null)
{
throw new Exception("Необходима авторизация");
}
var Result = ApiUser.GetRequest<AssemblyViewModel>($"api/assembly/getassembly?id={AssemblyId}");
if (Result == null)
{
return default;
}
return Result;
}
*/
public IActionResult CreateAssembly()
{
if (ApiUser.User == null)
throw new Exception("Вход только авторизованным");
ViewBag.Components = ApiUser.GetRequest<List<ComponentViewModel>>($"api/component/getcomponents?userId={ApiUser.User.Id}");
return View("Assembly");
}
[HttpPost]
public void CreateAssembly(string AssemblyName, double Price, string Category, int[] ComponentIds)
{
if (ApiUser.User == null)
throw new Exception("Вход только авторизованным");
var SelectedComponents = ComponentIds.ToDictionary(Id => Id, Id => new ComponentBindingModel { Id = Id });
ApiUser.PostRequest("api/assembly/createAssembly", new AssemblyBindingModel
{
UserId = ApiUser.User.Id,
AssemblyName = AssemblyName,
Price = Price,
Category = Category,
AssemblyComponents = SelectedComponents,
});
Response.Redirect("Assemblies");
}
public IActionResult UpdateAssembly(int Id)
{
if (ApiUser.User == null)
return Redirect("~/Home/Enter");
ViewBag.Components = ApiUser.GetRequest<List<ComponentViewModel>>($"api/component/getcomponents?userId={ApiUser.User.Id}");
return View("Assembly", ApiUser.GetRequest<AssemblyViewModel>($"api/assembly/getassembly?id={Id}"));
}
[HttpPost]
public void UpdateAssembly(int Id, string AssemblyName, double Price, string Category, int[] ComponentIds)
{
if (ApiUser.User == null)
throw new Exception("Вход только авторизованным");
if (Id == 0)
throw new Exception("Сборка не указана");
if (string.IsNullOrEmpty(AssemblyName))
throw new Exception("Название сборки не указано");
if (string.IsNullOrEmpty(Category))
throw new Exception("Категория не указана");
var SelectedComponents = ComponentIds.ToDictionary(Id => Id, Id => new ComponentBindingModel { Id = Id });
ApiUser.PostRequest("api/assembly/updateassembly", new AssemblyBindingModel
{
Id = Id,
UserId = ApiUser.User.Id,
AssemblyName = AssemblyName,
Price = Price,
Category = Category,
AssemblyComponents = SelectedComponents,
});
Response.Redirect("../Assemblies");
}
public void DeleteAssembly(int Id)
{
ApiUser.PostRequest($"api/assembly/deleteassembly", new AssemblyBindingModel { Id = Id });
Response.Redirect("../Assemblies");
}
// ОСТАЛЬНОЕ ОСТАЛЬНОЕ ОСТАЛЬНОЕ ОСТАЛЬНОЕ ОСТАЛЬНОЕ ОСТАЛЬНОЕ ОСТАЛЬНОЕ
[HttpGet]
public IActionResult Privacy() public IActionResult Privacy()
{ {
return View(); if (ApiUser.User == null)
{
return Redirect("~/Home/Enter");
}
return View(ApiUser.User);
}
[HttpPost]
public void Privacy(string Login, string Password, string Email)
{
if (ApiUser.User == null)
{
throw new Exception("Вход только авторизованным");
}
if (string.IsNullOrEmpty(Login) || string.IsNullOrEmpty(Password) || string.IsNullOrEmpty(Email))
{
throw new Exception("Введите логин, пароль и почту");
}
ApiUser.PostRequest("api/user/updatedata", new UserBindingModel
{
Id = ApiUser.User.Id,
Login = Login,
Password = Password,
Email = Email
});
ApiUser.User.Login = Login;
ApiUser.User.Password = Password;
ApiUser.User.Email = Email;
Response.Redirect("Index");
} }
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
@ -28,5 +257,52 @@ namespace ComputerShopGuarantorApp.Controllers
{ {
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
} }
public IActionResult Enter()
{
return View();
}
[HttpPost]
public void Enter(string Login, string Password)
{
if (string.IsNullOrEmpty(Login) || string.IsNullOrEmpty(Password))
{
throw new Exception("Введите логин и пароль");
}
ApiUser.User = ApiUser.GetRequest<UserViewModel>($"api/user/loginguarantor?login={Login}&password={Password}");
if (ApiUser.User == null)
{
throw new Exception("Неверный логин или пароль");
}
Response.Redirect("Index");
}
public IActionResult Register()
{
return View();
}
[HttpPost]
public void Register(string Login, string Password, string Email)
{
if (string.IsNullOrEmpty(Login) || string.IsNullOrEmpty(Password) || string.IsNullOrEmpty(Email))
{
throw new Exception("Введите логин, пароль и почту");
}
ApiUser.PostRequest("api/user/registerguarantor", new UserBindingModel
{
Login = Login,
Password = Password,
Email = Email
});
ApiUser.User = ApiUser.GetRequest<UserViewModel>($"api/user/loginguarantor?login={Login}&password={Password}");
if (ApiUser.User == null)
{
Response.Redirect("Enter");
}
Response.Redirect("Index");
return;
}
} }
} }

View File

@ -18,9 +18,7 @@ if (!App.Environment.IsDevelopment())
App.UseHttpsRedirection(); App.UseHttpsRedirection();
App.UseStaticFiles(); App.UseStaticFiles();
App.UseRouting(); App.UseRouting();
App.UseAuthorization(); App.UseAuthorization();
App.MapControllerRoute( App.MapControllerRoute(

View File

@ -0,0 +1,61 @@
@using ComputerShopContracts.ViewModels
@model List<AssemblyViewModel>
@{
ViewData["Title"] = "Сборки";
}
<div class="container-md py-4 mb-4">
<div class="text-center">
<h2>Список сборок</h2>
<p class="lead text-muted">Просматривайте список сборок и создавайте новые, а также выбирайте сборку для изменения или удаления</p>
</div>
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a class="btn btn-primary" asp-action="CreateAssembly">Создать сборку</a>
</p>
<table class="table table-striped">
<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.AssemblyName)
</td>
<td>
@Html.DisplayFor(ModelItem => Item.Price)
</td>
<td>
@Html.DisplayFor(ModelItem => Item.Category)
</td>
<td>
<a asp-action="UpdateAssembly" asp-route-Id="@(Item.Id)" role="button"><i class="bi bi-pen-fill"></i></a>
</td>
<td>
<a asp-action="DeleteAssembly" asp-route-Id="@(Item.Id)" role="button"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -0,0 +1,57 @@
@using ComputerShopDataModels.Enums;
@using ComputerShopContracts.ViewModels;
@model AssemblyViewModel
@{
ViewData["Title"] = "Сборка";
}
<div class="container-md py-4 mb-4">
<div class="text-center">
@if (Model == null)
{
<h2>Создание сборки</h2>
}
else
{
<h2>Редактирование сборки</h2>
}
</div>
<form method="post">
<div class="form-group">
<label class="mb-3">Название:</label>
<input type="text" name="assemblyName" class="mb-3 form-control" value="@(Model == null ? "" : Model.AssemblyName)">
</div>
<div class="form-group">
<label class="mb-3">Цена:</label>
<input type="number" name="cost" class="mb-3 form-control" value="@(Model == null ? 0 : Model.Price)" readonly>
</div>
<div class="form-group">
<label class="mb-3">Категория:</label>
<input type="text" name="category" class="mb-3 form-control" value="@(Model == null ? "" : Model.Category)">
</div>
<div class="form-group">
<label class="mb-3">Комплектующие:</label>
<select multiple size="6" name="componentIds" class="form-control">
@{
foreach (var Component in ViewBag.Components)
{
<option value="@Component.Id">@Component.ComponentName</option>
}
}
</select>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Сохранить" class="btn btn-primary" />
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,40 @@
@using ComputerShopDataModels.Enums;
@using ComputerShopContracts.ViewModels;
@model ComponentViewModel
@{
ViewData["Title"] = "Комплектующая";
}
<div class="container-md py-4 mb-4">
<div class="text-center">
@if (Model == null)
{
<h2>Создание комплектующей</h2>
}
else
{
<h2>Редактирование комплектующей</h2>
}
</div>
<form method="post">
<div class="form-group">
<label class="mb-3">Наименование:</label>
<input type="text" name="componentName" class="mb-3 form-control" value="@(Model == null ? "" : Model.ComponentName)">
</div>
<div class="form-group">
<label class="mb-3">Стоимость:</label>
<input type="number" name="cost" class="mb-3 form-control" step="1" value="@(Model == null ? 0 : Model.Cost)">
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Сохранить" class="btn btn-primary" />
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,57 @@
@using ComputerShopContracts.ViewModels
@model List<ComponentViewModel>
@{
ViewData["Title"] = "Комплектующие";
}
<div class="container-md py-4 mb-4">
<div class="text-center">
<h2>Список комплектующих</h2>
<p class="lead text-muted">Просматривайте список комплектующих и добавляйте новые, а также выбирайте комплектующую для изменения или удаления</p>
</div>
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a class="btn btn-primary" asp-action="CreateComponent">Создать комплектующую</a>
</p>
<table class="table table-striped">
<thead>
<tr>
<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.ComponentName)
</td>
<td>
@Html.DisplayFor(ModelItem => Item.Cost)
</td>
<td>
<a asp-action="UpdateComponent" asp-route-Id="@(Item.Id)" role="button"><i class="bi bi-pen-fill"></i></a>
</td>
<td>
<a asp-action="DeleteComponent" asp-route-Id="@(Item.Id)" role="button"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -0,0 +1,54 @@
@{
ViewData["Title"] = "Вход";
}
<div class="container-sm py-4">
<div class="text-center">
<h2>Вход в аккаунт</h2>
<p class="lead text-muted">Войдите в ваш аккаунт чтобы иметь доступ к комплектующим, сборкам и товарам</p>
</div>
<div class="row justify-content-center mt-5">
<div class="col-lg-4">
<div class="card">
<div class="card-body">
<div class="d-flex flex-row justify-content-center">
<i class="bi bi-person-circle login-icon text-primary" style="font-size: 30px"></i>
<p class="lead my-auto ms-3 text-primary">Вход</p>
</div>
<form method="post" class="my-3">
<label for="email" class="form-label">Логин</label>
<div class="input-group mb-3">
<span class="input-group-text"><i class="bi bi-envelope-fill"></i></span>
<input type="text" class="form-control" name="login">
</div>
<label for="password" class="form-label">Пароль</label>
<div class="input-group mb-3">
<span class="input-group-text"><i class="bi bi-lock-fill"></i></span>
<input type="password" class="form-control" name="password">
<div class="input-group-text" id="hidePassword">
<a href=""><i class="bi bi-eye-fill"></i></a>
</div>
</div>
<div class="input-group mt-4 d-flex justify-content-between">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="formCheck">
<label for="formCheck" class="form-check-label text-secondary"><small>Запомнить на этом компьютере</small></label>
</div>
<div class="forgot">
<p class="btn btn-sm text-primary p-0 border-0">Забыли пароль?</p>
</div>
</div>
<div class="text-center mt-5">
<input type="submit" value="Вход" class="btn btn-primary" />
</div>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,60 @@
@{
ViewData["Title"] = "Регистрация";
}
<div class="container-sm py-4">
<div class="text-center">
<h2>Регистрация аккаунта</h2>
<p class="lead text-muted">Зарегистрируйте аккаунт поручителя, чтобы управлять комплектующими, сборками и товарами</p>
</div>
<div class="row justify-content-center mt-5">
<div class="col-lg-4">
<div class="card">
<div class="card-body">
<div class="d-flex flex-row justify-content-center">
<i class="bi bi-people-fill login-icon text-primary" style="font-size: 30px"></i>
<p class="lead my-auto ms-3 text-primary">Регистрация</p>
</div>
<form method="post" class="my-3">
<label for="login" class="form-label">Логин</label>
<div class="input-group mb-3">
<span class="input-group-text"><i class="bi bi-chat-square-quote-fill"></i></span>
<input type="text" class="form-control" name="login">
</div>
<label for="email" class="form-label">Почта</label>
<div class="input-group mb-3">
<span class="input-group-text"><i class="bi bi-envelope-fill"></i></span>
<input type="email" class="form-control" name="email" placeholder="myemail@mail.com">
</div>
<label for="password" class="form-label">Пароль</label>
<div class="input-group mb-3">
<span class="input-group-text"><i class="bi bi-lock-fill"></i></span>
<input type="password" class="form-control" name="password">
<div class="input-group-text" id="hidePassword">
<a href=""><i class="bi bi-eye-fill"></i></a>
</div>
</div>
<div class="input-group mt-4 d-flex justify-content-between">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="formCheck">
<label for="formCheck" class="form-check-label text-secondary"><small>Запомнить на этом компьютере</small></label>
</div>
<div class="forgot">
<p class="btn btn-sm text-primary p-0 border-0">Забыли пароль?</p>
</div>
</div>
<div class="text-center mt-5">
<input type="submit" value="Зарегистрироваться" class="btn btn-primary" />
</div>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@ -5,14 +5,18 @@
<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"] - Поручитель</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="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.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="~/ComputerShopGuarantorApp.styles.css" asp-append-version="true" /> <link rel="stylesheet" href="~/ComputerShopGuarantorApp.styles.css" asp-append-version="true" />
</head> </head>
<body class="d-flex flex-column min-vh-100" padding="56px"> <body>
<header> <header>
<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark"> <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-md"> <div class="container-md">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index"><span class="fw-bold text-uppercase ms-2">Приложение поручителя</span></a> <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">
<i class="bi bi-pc-display-horizontal pt-5" style="font-size:30px; line-height:0px"></i>
<span class="fw-bold text-uppercase ms-2">Ты ж программист</span>
</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>
@ -20,17 +24,39 @@
<div class="collapse navbar-collapse justify-content-end align-center" id="main-nav"> <div class="collapse navbar-collapse justify-content-end align-center" id="main-nav">
<ul class="navbar-nav"> <ul class="navbar-nav">
<li class="nav-item me-3"> <li class="nav-item me-3">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Index">Главная</a> <a class="nav-link" asp-area="" asp-controller="Home" asp-action="Components">Комплектующие</a>
</li> </li>
<li class="nav-item me-3"> <li class="nav-item me-3">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a> <a class="nav-link" asp-area="" asp-controller="Home" asp-action="Assemblies">Сборки</a>
</li>
<li class="nav-item me-3">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Products">Товары</a>
</li>
<li class="nav-item me-3">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Index">Отчет</a>
</li>
<li class="nav-item me-3">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Index">Выгрузка списка</a>
</li>
@if (ApiUser.User == null)
{
<li class="nav-item me-3">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
</li> </li>
<li class="nav-item d-lg-none"> <li class="nav-item d-lg-none">
<a class="nav-link text-light" asp-area="" asp-controller="Home" asp-action="Privacy">Вход в аккаунт</a> <a class="nav-link text-light" asp-area="" asp-controller="Home" asp-action="Enter">Вход в аккаунт</a>
</li> </li>
<li class="nav-item d-none d-lg-inline"> <li class="nav-item d-none d-lg-inline">
<a class="btn btn-light" asp-area="" asp-controller="Home" asp-action="Privacy">Вход в аккаунт</a> <a class="btn btn-light" asp-area="" asp-controller="Home" asp-action="Enter">Вход в аккаунт</a>
</li> </li>
}
else
{
<li class="nav-item me-3">
<a class="nav-link" asp-area="" asp-controller="Home" asp-action="Privacy">Профиль</a>
</li>
}
</ul> </ul>
</div> </div>
</div> </div>
@ -42,9 +68,9 @@
</main> </main>
</div> </div>
<footer class="border-top footer text-muted"> <footer class="bg-dark text-light mt-auto footer">
<div class="container"> <div class="container">
&copy; 2024 - ComputerShopGuarantorApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a> &copy; 2024 - "Ты ж программист" @* - <a asp-area="" asp-controller="Home" asp-action="Privacy" class="text-decoration-underline text-secondary">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

@ -6,5 +6,5 @@
} }
}, },
"AllowedHosts": "*", "AllowedHosts": "*",
"IPAddress": "http://localhost:5024" "IpAddress": "http://localhost:5055"
} }

View File

@ -97,7 +97,7 @@ namespace ComputerShopRestApi.Controllers
} }
} }
[HttpDelete] [HttpPost]
public void DeleteAssembly(AssemblyBindingModel Model) public void DeleteAssembly(AssemblyBindingModel Model)
{ {
try try

View File

@ -81,7 +81,7 @@ namespace ComputerShopRestApi.Controllers
} }
} }
[HttpDelete] [HttpPost]
public void DeleteComponent(ComponentBindingModel Model) public void DeleteComponent(ComponentBindingModel Model)
{ {
try try

View File

@ -82,7 +82,7 @@ namespace ComputerShopRestApi.Controllers
} }
} }
[HttpDelete] [HttpPost]
public void DeleteProduct(ProductBindingModel Model) public void DeleteProduct(ProductBindingModel Model)
{ {
try try