我有这样的看法:
@model IEnumerable<PMS.Models.Activity_Contractor>
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_LayoutPageArchitect.cshtml";
}
<h2>Index</h2>
<p>
@*@Html.ActionLink("Create New", "Create")*@
</p>
<table>
<tr>
@*<th>
@Html.DisplayNameFor(model => model.A_C_ID)
</th>*@
<th>
@Html.DisplayName("ProjectName")
</th>
<th>
@Html.DisplayNameFor(model => model.ProjectActivityMaster.ActivityName)
</th>
<th>
@Html.DisplayNameFor(model => model.ContractorMaster.ContractorName)
</th>
<th>
@Html.DisplayNameFor(model => model.IsActive)
</th>
@* <th>
@Html.DisplayNameFor(model => model.CreatedBy)
</th>
<th>
@Html.DisplayNameFor(model => model.CreatedON)
</th>
<th>
@Html.DisplayNameFor(model => model.UpdatedBy)
</th>
<th>
@Html.DisplayNameFor(model => model.UpdatedON)
</th>*@
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
@*<td>
@Html.DisplayFor(modelItem => item.A_C_ID)
</td>*@
<td>
@Html.Label("Project")
</td>
<td>
@Html.DisplayFor(modelItem => item.ProjectActivityMaster.ActivityName)
</td>
<td>
@Html.DisplayFor(modelItem => item.ContractorMaster.ContractorName)
</td>
<td>
@Html.DisplayFor(modelItem => item.IsActive)
</td>
@* <td>
@Html.DisplayFor(modelItem => item.CreatedBy)
</td>
<td>
@Html.DisplayFor(modelItem => item.CreatedON)
</td>
<td>
@Html.DisplayFor(modelItem => item.UpdatedBy)
</td>
<td>
@Html.DisplayFor(modelItem => item.UpdatedON)
</td>*@
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.A_C_ID }) |
@Html.ActionLink("Details", "Details", new { id=item.A_C_ID }) |
@Html.ActionLink("Delete", "Delete", new { id=item.A_C_ID })
</td>
</tr>
}
</table>
我的 item.IsActive 值曾经是 1/0 我想将其视为 True if 1 和 False id 0。我该怎么做?