sara_t
دوشنبه 29 شهریور 1395, 09:30 صبح
سلام دوستان
من چطور میتونم یه ستون در تیبلم داشته باشم که تعداد کالا رو در قیمتش ضرب کنه و حاصل رو بنویسه؟
ممنون میشم
<table class="table-full table-total">
<tr>
<th>
@Html.DisplayName("تصویر")
</th>
<th>
@Html.DisplayName("نام محصول")
</th>
<th>
@Html.DisplayName("قیمت")
</th>
<th>
@Html.DisplayName("تعداد")
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ImageFor(modelItem => item.Product.Image, new { width = "80" }, "Tulips.jpg", "Files", "UploadImages")
</td>
<td>
@Html.DisplayFor(modelItem => item.Product.Name)
<img src="~/Content/Images/delete.png" alt="حذف محصول" style="cursor:pointer;" class="deleteProduct" productid="@item.Product.Id" />
</td>
<td>
@item.Product.Price.ToString().Trim('0').Trim('.') .ToPrice() تومان
</td>
<td>
@Html.TextAreaFor(modelItem => item.Count, new { @class = "text txtCountProduct", style = "width: 40px;", productid = item.Product.Id })
</td>
<td>
@item.Count * @item.Product.Price
</td>
@*<td>
@Html.ActionLink("ویرایش", "EditProduct", new { id = item.Id }) |
@Html.ActionLink("حذف", "DeleteProduct", new { id = item.Id }, new { onclick = "return confirm('جهت حذف مطمئن هستید ؟')" })
</td>*@
</tr>
}
</table>
من چطور میتونم یه ستون در تیبلم داشته باشم که تعداد کالا رو در قیمتش ضرب کنه و حاصل رو بنویسه؟
ممنون میشم
<table class="table-full table-total">
<tr>
<th>
@Html.DisplayName("تصویر")
</th>
<th>
@Html.DisplayName("نام محصول")
</th>
<th>
@Html.DisplayName("قیمت")
</th>
<th>
@Html.DisplayName("تعداد")
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ImageFor(modelItem => item.Product.Image, new { width = "80" }, "Tulips.jpg", "Files", "UploadImages")
</td>
<td>
@Html.DisplayFor(modelItem => item.Product.Name)
<img src="~/Content/Images/delete.png" alt="حذف محصول" style="cursor:pointer;" class="deleteProduct" productid="@item.Product.Id" />
</td>
<td>
@item.Product.Price.ToString().Trim('0').Trim('.') .ToPrice() تومان
</td>
<td>
@Html.TextAreaFor(modelItem => item.Count, new { @class = "text txtCountProduct", style = "width: 40px;", productid = item.Product.Id })
</td>
<td>
@item.Count * @item.Product.Price
</td>
@*<td>
@Html.ActionLink("ویرایش", "EditProduct", new { id = item.Id }) |
@Html.ActionLink("حذف", "DeleteProduct", new { id = item.Id }, new { onclick = "return confirm('جهت حذف مطمئن هستید ؟')" })
</td>*@
</tr>
}
</table>