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

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.Выдан);
}
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;
}
public IActionResult CreateOrder()
{
return View();
}
public IActionResult CreateGood()
{
return View();
}
public IActionResult LinkBuilds()
{
return View();

View File

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

View File

@ -14,7 +14,7 @@
</div>
<div class="col-sm-3">
<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 class="col-sm-2 d-flex justify-content-evenly align-items-baseline">
<button type="submit" class="btn btn-primary mt-3 px-4">Подтвердить</button>

View File

@ -14,13 +14,24 @@
</div>
<div class="col-sm-3">
<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>
<table class="table table-hover">
<thead>
<tr>
<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>
</thead>
<tbody>

View File

@ -14,7 +14,7 @@
</div>
<div class="col-sm-3">
<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 class="col-sm-3">
<label class="form-label">Сумма</label>

View File

@ -9,7 +9,6 @@
</div>
<div class="text-center">
@{
<p>
<a asp-action="CreateGood" class="mx-2">Создать товар</a>
<a asp-action="Goods" class="mx-2">Изменить товар</a>
@ -32,5 +31,4 @@
<tbody>
</tbody>
</table>
}
</div>

View File

@ -12,12 +12,20 @@
<div class="col-sm-3">
<label class="form-label">Комплектующее</label>
<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>
<h1 class="display-6">Привязанные сборки</h1>
<table class="table table-hover">
<thead>
<tr>
<th id="name" scope="col">Сборка</th>
<th id="price" scope="col">Цена</th>
<th id="price" scope="col">Количество</th>
</tr>
</thead>
<tbody>

View File

@ -5,5 +5,23 @@
}
<div class="text-center">
<h1 class="display-4">Список сборок</h1>
<h1 class="display-4">Получение списка сборок</h1>
</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";
}
<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>

View File

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