Добавление удаления продаж
This commit is contained in:
parent
932493b9f7
commit
82ee4b8e60
@ -209,5 +209,14 @@ namespace EmployeeApp.Controllers
|
||||
_saleLogic.Create(new SaleBindingModel { EmployeeId = APIClient.Employee.Id, Sum = (float)Convert.ToDouble(sum), CarId=car });
|
||||
Response.Redirect("Sales");
|
||||
}
|
||||
public void DeleteSale(int id)
|
||||
{
|
||||
if (APIClient.Employee == null)
|
||||
{
|
||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
||||
}
|
||||
_saleLogic.Delete(new SaleBindingModel { Id = id });
|
||||
Response.Redirect("/Home/Sales");
|
||||
}
|
||||
}
|
||||
}
|
@ -51,9 +51,6 @@
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.EmployeeName)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Car" asp-route-id="@item.Id">Посмотреть</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<div class="col-8"><input type="text" name="name" id="name" /></div>
|
||||
<div class="col-4">Предпродажные работы:</div>
|
||||
<div class="col-8">
|
||||
<select id="presales" name="presales" class="form-control" multiple asp-items="@(new SelectList(@ViewBag.Presales,"Id", "PresaleDate"))"></select>
|
||||
<select id="presales" name="presales" class="form-control" multiple asp-items="@(new SelectList(@ViewBag.Presales,"Id", "Name"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -55,6 +55,9 @@
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.CarId)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="DeleteSale" asp-route-id="@item.Id">Удалить</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
Loading…
x
Reference in New Issue
Block a user