1
我有2個字段的數量和價格。我基本上想要將它們相乘並獲得另一列名爲Price(它是乘法的總和)的值。如何將表中的兩列相乘以生成新列
我已經使用了HTML代碼如下嘗試:
@Html.DisplayFor(modelItem => item.item_order_quantity*item.ITEM.item_price)
這是我的錶行的代碼:
<table class="table table-striped table-advance table-hover">
<tbody>
<tr>
<th><i class="icon_pin_alt"></i> Item Description</th>
<th><i class="icon_pin_alt"></i> Quantity</th>
<th><i class="icon_calendar"></i> Price</th>
</tr>
@foreach (var item in Model.ITEM_ORDER)
{
<tr>
<td style="width:auto">
@Html.DisplayFor(modelItem => item.ITEM.item_description)
</td>
<td style="width:auto">
@Html.DisplayFor(modelItem => item.item_order_quantity)
</td>
<td style="width:auto">
@Html.DisplayFor(modelItem => item.item_order_quantity*item.ITEM.item_price)
</td>
<td>
<div class="btn-group">
@Html.ActionLink("View", "Details", new { id = item.OrderID }) |
@Html.ActionLink("Edit", "Edit", new { id = item.OrderID }) |
@Html.ActionLink("Delete", "Delete", new { id = item.OrderID })
</div>
</td>
</tr>
}
</tbody>
</table>
謝謝您的答覆。它像一個魅力。我現在需要做的是在底部的客戶發票總額中不斷累計總額,併爲此增加增值稅,也可能會計算物品數量。我將如何做到這一點?它會在桌子上嗎? –