@Html.DropDownListFor(i => item.Count, new SelectList(
new List
new { value = 0, text = "0"},,
new { value = 5, text = "5"}},
"value", "text", item.Count
), new { @class = "f-count" })
$('.f-size').change(function () {
var dropdown = $(this);
var size = dropdown.val();
var count = dropdown.parents('tr').find('.f-count').val();
var price = dropdown.parents('tr').find('.f-price').text();
dropdown.parents('tr').find('.f-money').text((size / 2) * count * price);
});
$.ajax({
type: "POST",
url: "@Url.Action("AddOrUpdateOrder", "Food")",
data: "{FoodId:'" + FoodId + "', ReservationId:'" + ReservationId + "', Count:'" + Count + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert(msg.data);
},
error: function (msg) {
}
});
Không có nhận xét nào:
Đăng nhận xét