私はこのようなビューを持っています:
@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 でした。1 の場合は True、ID が 0 の場合は False として表示されます。どうすればそれを行うことができますか?