Cześć. Mam pytanie czy jest możliwość aby po wyborze z listy enumdropdownList od razu bez wcisnięcia potwierdzenia buttonem ?
@model IEnumerable<Sklep.Models.OrderItems>
@{
ViewBag.Title = "ListYourProduct";
}
<h2>Lista Produktów zamówiona przez twoich klientów</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Nazwa</th>
<th>Cena</th>
<th>Ilość</th>
<th>Imię</th>
<th>Nazwisko</th>
<th>Stan zamówienia</th>
<th>Akacja</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@item.Product.Name</td>
<td>@item.Price</td>
<td>@item.Quantity</td>
<td>@item.Orders.FirstName</td>
<td>@item.Orders.SecondName</td>
<td>
@using (Html.BeginForm("ChangeOrderStatus", "Manage"))
{
@Html.HiddenFor(x => item.OrderItemsId)
@Html.EnumDropDownListFor(o => item.OrderStatus)
}
</td>
<td><a href="@Url.Action("OrderProductDetails", "Order", new { id = item.OrderItemsId })">Szczegóły</a></td>
</tr>
}
</tbody>
</table>
//OrderController
public OrderStatus ChangeOrderStatus(OrderItems order)
{
OrderItems newOrder = db.OrdersItems.Find(order.OrderItemsId);
newOrder.OrderStatus = order.OrderStatus;
db.SaveChanges();
return order.OrderStatus;
}