Cześć Mam pytanie wiecie może czemu ten formularz nie przesyła danych do public ActionResult ChangeOrderStatus(OrderItems orderItems) w konrolerze order ?
[HttpPost]
public ActionResult ChangeOrderStatus(OrderItems orderItems)
{
OrderItems newOrder = db.OrdersItems.SingleOrDefault(x =>x.OrderItemsId == orderItems.OrderItemsId);
newOrder.OrderStatus = orderItems.OrderStatus;
db.SaveChanges();
return View("ListYourProduct");
}
@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", "Order", new { id = item.OrderItemsId}))
{
@Html.HiddenFor(x=>item.OrderItemsId)
@Html.EnumDropDownListFor(x => item.OrderStatus, new { onchange = "this.form.submit();" })
}
</td>
<td><a href="@Url.Action("OrderProductDetails", "Order", new { id = item.OrderItemsId })">Szczegóły</a></td>
</tr>
}