Остался отчет

This commit is contained in:
dasha 2023-04-03 18:24:24 +04:00
parent 2e505618bc
commit 2a7782eea0
11 changed files with 147 additions and 58 deletions

View File

@ -120,5 +120,17 @@ namespace HardwareShopBusinessLogic.BusinessLogics.Storekeeper
{ {
return StatusUpdate(model, OrderStatus.Выдан); return StatusUpdate(model, OrderStatus.Выдан);
} }
public bool Delete(OrderBindingModel model)
{
CheckModel(model, false);
_logger.LogInformation("Delete. Id: {Id}", model.Id);
if (_orderStorage.Delete(model) == null)
{
_logger.LogWarning("Delete operation failed");
return false;
}
return true;
}
} }
} }

View File

@ -10,11 +10,16 @@ namespace HardwareShopClientApp.Controllers
{ {
_logger = logger; _logger = logger;
} }
public IActionResult CreateOrder()
{
return View();
}
public IActionResult CreateGood() public IActionResult CreateGood()
{ {
return View(); return View();
} }
public IActionResult LinkBuilds() public IActionResult LinkBuilds()
{ {
return View(); return View();

View File

@ -10,29 +10,24 @@
<div class="text-center"> <div class="text-center">
@{ <p>
<p> <a asp-action="CreateComponent" class="mx-2">Создать комплектующее</a>
<a asp-action="CreateComponent" class="mx-2">Создать комплектующее</a> <a href="#" class="mx-2">Изменить комплектующее</a>
<a asp-action="Components" class="mx-2">Изменить комплектующее</a> <a href="#" class="mx-2">Удалить комплектующее</a>
<a asp-action="Components" class="mx-2">Удалить комплектующее</a> <a asp-action="LinkBuilds" class="mx-2">Привязка сборок</a>
<a asp-action="LinkBuilds" class="mx-2">Привязка сборок</a> </p>
</p> <table class="table">
<table class="table"> <thead>
<thead> <tr>
<tr> <th>
<th> Название
Название </th>
</th> <th>
<th> Цена
Цена </th>
</th> </tr>
<th> </thead>
Сборки <tbody>
</th> </tbody>
</tr> </table>
</thead>
<tbody>
</tbody>
</table>
}
</div> </div>

View File

@ -14,7 +14,7 @@
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<label class="form-label">Стоимость</label> <label class="form-label">Стоимость</label>
<input type="number" step="0.01" class="form-control" name="cost"> <input type="number" step="0.01" class="form-control" name="cost" min="0.01">
</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>

View File

@ -14,13 +14,24 @@
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<label class="form-label">Цена</label> <label class="form-label">Цена</label>
<input type="number" step="0.01" class="form-control" name="price" readonly> <input type="number" step="0.01" class="form-control" name="price" readonly min="0.01">
</div>
<h1 class="display-6">Добавление комплектующих</h1>
<div class="col-sm-3">
<label class="form-label">Комплектующее</label>
<select class="form-control" name="component"></select>
<label class="form-label">Количество</label>
<input type="number" class="form-control" name="count" min="1">
<div class="d-flex justify-content-center">
<button type="submit" class="btn btn-primary mt-3 px-4">Добавить</button>
</div>
</div> </div>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th id="name" scope="col">Комплектующее</th> <th id="name" scope="col">Комплектующее</th>
<th id="cost" scope="col">Стоимость</th> <th id="count" scope="col">Количество</th>
<th id="sum" scope="col">Сумма</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -14,7 +14,7 @@
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<label class="form-label">Количество</label> <label class="form-label">Количество</label>
<input type="number" class="form-control" name="count"> <input type="number" class="form-control" name="count" min="1">
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<label class="form-label">Сумма</label> <label class="form-label">Сумма</label>

View File

@ -9,28 +9,26 @@
</div> </div>
<div class="text-center"> <div class="text-center">
@{ <p>
<p> <a asp-action="CreateGood" class="mx-2">Создать товар</a>
<a asp-action="CreateGood" class="mx-2">Создать товар</a> <a asp-action="Goods" class="mx-2">Изменить товар</a>
<a asp-action="Goods" class="mx-2">Изменить товар</a> <a asp-action="Goods" class="mx-2">Удалить товар</a>
<a asp-action="Goods" class="mx-2">Удалить товар</a> </p>
</p> <table class="table">
<table class="table"> <thead>
<thead> <tr>
<tr> <th>
<th> Название
Название </th>
</th> <th>
<th> Цена
Цена </th>
</th> <th>
<th> Комплектующие
Комплектующие </th>
</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> </tbody>
</tbody> </table>
</table>
}
</div> </div>

View File

@ -12,12 +12,20 @@
<div class="col-sm-3"> <div class="col-sm-3">
<label class="form-label">Комплектующее</label> <label class="form-label">Комплектующее</label>
<select class="form-control" name="component"></select> <select class="form-control" name="component"></select>
<label class="form-label">Сборка</label>
<select class="form-control" name="build"></select>
<label class="form-label">Количество</label>
<input type="number" class="form-control" name="count" min="1">
<div class="d-flex justify-content-center">
<button type="submit" class="btn btn-primary mt-3 px-4">Привязать</button>
</div>
</div> </div>
<h1 class="display-6">Привязанные сборки</h1>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th id="name" scope="col">Сборка</th> <th id="name" scope="col">Сборка</th>
<th id="price" scope="col">Цена</th> <th id="price" scope="col">Количество</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -5,5 +5,23 @@
} }
<div class="text-center"> <div class="text-center">
<h1 class="display-4">Список сборок</h1> <h1 class="display-4">Получение списка сборок</h1>
</div> </div>
<form method="post" class="d-flex flex-column align-items-center">
<h1 class="display-6">Выбранные товары</h1>
<table class="table">
<thead>
<tr>
<th>
Товар
</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

@ -4,6 +4,47 @@
Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml"; Layout = "~/Views/Shared/_LayoutStorekeeper.cshtml";
} }
<div> <div class="text-center">
привет, мы в заказах <h1 class="display-4">Заказы</h1>
</div>
<div class="text-center">
<p>
<a asp-action="CreateOrder" class="mx-2">Создать заказ</a>
<a href="#" class="mx-2">Удалить заказ</a>
<a href="#" class="mx-2">Принят</a>
<a href="#" class="mx-2">Выполняется</a>
<a href="#" class="mx-2">Готов</a>
<a href="#" class="mx-2">Выдан</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Товар
</th>
<th>
Количество
</th>
<th>
Сумма
</th>
<th>
Статус
</th>
<th>
Дата создания
</th>
<th>
Дата выполнения
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div> </div>

View File

@ -11,5 +11,6 @@ namespace HardwareShopContracts.BuisnessLogicsContracts
bool TakeOrderInWork(OrderBindingModel model); bool TakeOrderInWork(OrderBindingModel model);
bool FinishOrder(OrderBindingModel model); bool FinishOrder(OrderBindingModel model);
bool DeliveryOrder(OrderBindingModel model); bool DeliveryOrder(OrderBindingModel model);
bool Delete(OrderBindingModel model);
} }
} }