На прения с самим
собою ночь убив, глотаешь дым, уже не прочь в набрякшую гортань рукой залезть. По пуговицам грань готов провесть.
This commit is contained in:
parent
24634aab19
commit
a076324789
@ -1,7 +1,9 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonBusinesLogic.BusinessLogic;
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.BusinessLogicContracts;
|
||||
using BeautySalonContracts.SearchModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
using BeautySalonDatabaseImplement.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace WorkerWebApp.Controllers
|
||||
@ -9,19 +11,34 @@ namespace WorkerWebApp.Controllers
|
||||
|
||||
public class EvaluationController : Controller
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly ILogger logger;
|
||||
|
||||
private readonly IProcedureLogic _procedureLogic;
|
||||
private readonly IEvaluationLogic evaluation;
|
||||
private readonly IProcedureLogic procedure;
|
||||
|
||||
private readonly IEvaluationLogic _evaluationLogic;
|
||||
|
||||
public EvaluationController(ILogger<EvaluationController> logger, IEvaluationLogic evaluationLogic, IProcedureLogic procedureLogic)
|
||||
public EvaluationController(ILogger<EvaluationController> logger, IEvaluationLogic evaluation, IProcedureLogic procedure)
|
||||
{
|
||||
_logger = logger;
|
||||
_evaluationLogic = evaluationLogic;
|
||||
_procedureLogic = procedureLogic;
|
||||
this.logger = logger;
|
||||
this.evaluation = evaluation;
|
||||
this.procedure = procedure;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public EvaluationViewModel? GetEvalulation(int id)
|
||||
{
|
||||
try
|
||||
{
|
||||
return evaluation.ReadElement(new EvaluationSearchModel
|
||||
{
|
||||
Id = id
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, "Ошибка получения трудозатраты");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Evaluation()
|
||||
@ -31,7 +48,7 @@ namespace WorkerWebApp.Controllers
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
|
||||
return View(_evaluationLogic.ReadList(null));
|
||||
return View(evaluation.ReadList(null));
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult CreateEvaluation()
|
||||
@ -41,7 +58,7 @@ namespace WorkerWebApp.Controllers
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
|
||||
ViewBag.Procedure = _procedureLogic.ReadList(new ProcedureSearchModel
|
||||
ViewBag.Procedure = procedure.ReadList(new ProcedureSearchModel
|
||||
{
|
||||
WorkerId = APIWorker.Worker.Id,
|
||||
});
|
||||
@ -62,7 +79,7 @@ namespace WorkerWebApp.Controllers
|
||||
throw new Exception("Введены не все данные!");
|
||||
}
|
||||
|
||||
_evaluationLogic.Create(new EvaluationBindingModel
|
||||
evaluation.Create(new EvaluationBindingModel
|
||||
{
|
||||
PointsProcedure = pointsProcedures,
|
||||
PointsCosmetics = pointsCosmetics,
|
||||
@ -79,12 +96,12 @@ namespace WorkerWebApp.Controllers
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
|
||||
ViewBag.Procedures = _procedureLogic.ReadList(new ProcedureSearchModel
|
||||
ViewBag.Procedures = procedure.ReadList(new ProcedureSearchModel
|
||||
{
|
||||
WorkerId = APIWorker.Worker.Id,
|
||||
});
|
||||
|
||||
return View(_evaluationLogic.ReadElement(new EvaluationSearchModel
|
||||
return View(evaluation.ReadElement(new EvaluationSearchModel
|
||||
{
|
||||
Id = id
|
||||
}));
|
||||
@ -103,7 +120,7 @@ namespace WorkerWebApp.Controllers
|
||||
}
|
||||
|
||||
|
||||
_evaluationLogic.Update(new EvaluationBindingModel
|
||||
evaluation.Update(new EvaluationBindingModel
|
||||
{
|
||||
Id = id,
|
||||
PointsProcedure = pointsProcedures,
|
||||
|
@ -1,16 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Процедуры";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать процедуры</h4>
|
||||
|
||||
<form method="post" asp-controller="Procedure" asp-action="Create">
|
||||
<p class="mb-0">Название:</p>
|
||||
<input type="text" name="ProcedureName" class="form-control mb-3" />
|
||||
<p class="mb-0">Стоимость:</p>
|
||||
<input type="number" step="0.01" min="0.01" name="ProcedurePrice" class="form-control mb-3" />
|
||||
<p class="mb-0">Длительность процедуры:</p>
|
||||
<input type="text" name="ProcedureDuration" class="form-control mb-3" />
|
||||
Создать
|
||||
</button>
|
||||
</form>
|
@ -0,0 +1,48 @@
|
||||
@{
|
||||
ViewData["Title"] = "Создание процедуры";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Создание процедуры</h2>
|
||||
</div>
|
||||
|
||||
<form method="post" style="margin-top: 50px">
|
||||
<!-- Название -->
|
||||
<div class="row">
|
||||
<div class="col-4">Название:</div>
|
||||
<div class="col-8"><input type="text" name="name" id="name" /></div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Цена -->
|
||||
<div class="row">
|
||||
<div class="col-4">Цена:</div>
|
||||
<div class="col-8"><input type="text" name="price" id="price" /></div>
|
||||
</div>
|
||||
|
||||
<!-- Бренд -->
|
||||
<div class="row">
|
||||
<div class="col-4">Длительность:</div>
|
||||
<div class="col-8"><input type="text" name="duration" id="duration" /></div>
|
||||
</div>
|
||||
|
||||
<!-- Трудозатрата -->
|
||||
<div class="row">
|
||||
<div class="col-4">Оценка:</div>
|
||||
<div class="col-8">
|
||||
<select name="evaluation" id="evaluation" class="form-control">
|
||||
@foreach (var evaluation in ViewBag.Evaluation)
|
||||
{
|
||||
<option value="@evaluation.Id">@evaluation.Id</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>
|
||||
|
@ -1,18 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Процедуры";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить процедуры</h4>
|
||||
|
||||
<form method="post" asp-controller="Cosmetic" asp-action="Update">
|
||||
<input name="id" value="@ViewBag.Cosmetic.Id" style="display: none;" />
|
||||
<p class="mb-0">Название:</p>
|
||||
<input type="text" name="ProcedureName" class="form-control mb-3" />
|
||||
<p class="mb-0">Стоимость:</p>
|
||||
<input type="number" step="0.01" min="0.01" name="ProcedurePrice" class="form-control mb-3" />
|
||||
<p class="mb-0">Длительность процедуры:</p>
|
||||
<input type="text" name="ProcedureDuration" class="form-control mb-3" />
|
||||
<button type="submit" class="button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
</form>
|
@ -0,0 +1,51 @@
|
||||
@using BeautySalonContracts.ViewModels
|
||||
|
||||
@model ProcedureViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Редактирование процедуры";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h2 class="display-4">Редактирование процедуры</h2>
|
||||
</div>
|
||||
|
||||
<form method="post" style="margin-top: 50px">
|
||||
<!-- Название -->
|
||||
<div class="row">
|
||||
<div class="col-4">Название:</div>
|
||||
<div class="col-8"><input type="text" name="name" value="@Model.ProcedureName" /></div>
|
||||
</div>
|
||||
|
||||
<!-- Цена -->
|
||||
<div class="row">
|
||||
<div class="col-4">Цена:</div>
|
||||
<div class="col-8"><input type="text" name="price" value="@Model.ProcedurePrice" /></div>
|
||||
</div>
|
||||
|
||||
<!-- Бренд -->
|
||||
<div class="row">
|
||||
<div class="col-4">Длительность:</div>
|
||||
<div class="col-8"><input type="text" name="Duration" value="@Model.ProcedureDuration" /></div>
|
||||
</div>
|
||||
|
||||
<!-- Трудозатрата -->
|
||||
<div class="row">
|
||||
<div class="col-4">Оценки:</div>
|
||||
<div class="col-8">
|
||||
<select name="Evaluation" id="evaluation" class="form-control">
|
||||
@foreach (var evaluation in ViewBag.Evaluation)
|
||||
{
|
||||
var isSelected = Model.EvaluationId.Equals(evaluation.Id);
|
||||
<option value="@evaluation.Id" selected="@isSelected">@evaluation.Id</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>
|
@ -7,13 +7,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="Views\Procedure\Create.cshtml" />
|
||||
<Content Remove="Views\Procedure\Update.cshtml" />
|
||||
<Content Remove="Views\Procedure\CreateProcedure.cshtml" />
|
||||
<Content Remove="Views\Procedure\UpdateProcedure.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Views\Procedure\Create.cshtml" />
|
||||
<None Include="Views\Procedure\Update.cshtml" />
|
||||
<None Include="Views\Procedure\CreateProcedure.cshtml" />
|
||||
<None Include="Views\Procedure\UpdateProcedure.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user