Фикс недочета с пожеланиями

This commit is contained in:
Marselchi 2024-05-29 00:13:17 +04:00
parent 9f6ed8e650
commit 6af8cfd42e
4 changed files with 23 additions and 0 deletions

View File

@ -13,6 +13,8 @@ namespace CarCenterContracts.ViewModels
{
public int Id { get; set; }
public int PresaleId { get; set; }
[DisplayName("Описание работы")]
public string PresaleDescription { get; set; } = string.Empty;
[DisplayName("Описание пожелания")]
public string Description { get; set; } = string.Empty;
[DisplayName("Тип пожелания")]

View File

@ -53,6 +53,7 @@ namespace CarCenterDatabaseImplement.Models
Description = Description,
RequestType = RequestType,
PresaleId = PresaleId,
PresaleDescription = Presale?.Description ?? string.Empty,
};
}
}

View File

@ -30,6 +30,18 @@
<span id="TypeError" class="text-danger"></span>
</div>
</div>
<div class="row">
<div class="col-4">Предпродажная работа:</div>
<div class="col-8">
<select name="Presale" id="Presale">
@foreach (var presale in ViewBag.Presales)
{
<option value="@presale.Description">Предпродажная работа @presale.Description</option>
}
</select>
<span id="PresaleError" class="text-danger"></span>
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
@ -42,9 +54,11 @@
$('#requestForm').submit(function (event) {
var Type = $('#Type').val();
var Description = $('#Description').val();
var Presale = $('#Presale').val();
var isValid = true;
$('#TypeError').text('');
$('#DescriptionError').text('');
$('#PresaleError').text('');
if (!isValid) {

View File

@ -29,6 +29,9 @@
<th>
Описание
</th>
<th>
Описание работы
</th>
<th>
Тип пожелания
</th>
@ -50,6 +53,9 @@
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.PresaleDescription)
</td>
<td>
@Html.DisplayFor(modelItem => item.RequestType)
</td>