Kodlara devaö ediyorum….

———————————-Details————————————

@model OrganizationDetails.Models.Enrollment

@{
ViewBag.Title = “Details”;
}

<h2>Details</h2>

<div>
<h4>Enrollment</h4>
<hr />
<dl class=”dl-horizontal”>
<dt>
@Html.DisplayNameFor(model => model.Band)
</dt>

<dd>
@Html.DisplayFor(model => model.Band)
</dd>

<dt>
@Html.DisplayNameFor(model => model.Department.Title)
</dt>

<dd>
@Html.DisplayFor(model => model.Department.Title)
</dd>

<dt>
@Html.DisplayNameFor(model => model.Employee.LastName)
</dt>

<dd>
@Html.DisplayFor(model => model.Employee.LastName)
</dd>

</dl>
</div>
<p>
@Html.ActionLink(“Edit”, “Edit”, new { id = Model.EnrollmentID }) |
@Html.ActionLink(“Back to List”, “Index”)
</p>

————————————Edit—————————————-
@model OrganizationDetails.Models.Enrollment
@{
    ViewBag.Title = “Edit”;
}
<h2>Edit</h2>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <div class=”form-horizontal”>
        <h4>Enrollment</h4>
        <hr />
        @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.EnrollmentID)
        <div class=”form-group”>
            @Html.LabelFor(model => model.Band, new { @class = “control-label col-md-2” })
            <div class=”col-md-10″>
                @Html.EditorFor(model => model.Band)
                @Html.ValidationMessageFor(model => model.Band)
            </div>
        </div>
        <div class=”form-group”>
            @Html.LabelFor(model => model.DepartmentID, “DepartmentID”, new { @class = “control-label col-md-2” })
            <div class=”col-md-10″>
                @Html.DropDownList(“DepartmentID”, String.Empty)
                @Html.ValidationMessageFor(model => model.DepartmentID)
            </div>
        </div>
        <div class=”form-group”>
            @Html.LabelFor(model => model.EmployeeID, “EmployeeID”, new { @class = “control-label col-md-2” })
            <div class=”col-md-10″>
                @Html.DropDownList(“EmployeeID”, String.Empty)
                @Html.ValidationMessageFor(model => model.EmployeeID)
            </div>
        </div>
        <div class=”form-group”>
            <div class=”col-md-offset-2 col-md-10″>
                <input type=”submit” value=”Save” class=”btn btn-default” />
            </div>
        </div>
    </div>
}
<div>
    @Html.ActionLink(“Back to List”, “Index”)
</div>
@section Scripts {
    @Scripts.Render(“~/bundles/jqueryval”)
}
———————————–Index—————————-
@model IEnumerable<OrganizationDetails.Models.Enrollment>
@{
    ViewBag.Title = “Index”;
}
<h2>Index</h2>
<p>
    @Html.ActionLink(“Create New”, “Create”)
</p>
<table class=”table”>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Band)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Department.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Employee.LastName)
        </th>
        <th></th>
    </tr>
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Band)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Department.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Employee.LastName)
        </td>
        <td>
            @Html.ActionLink(“Edit”, “Edit”, new { id=item.EnrollmentID }) |
            @Html.ActionLink(“Details”, “Details”, new { id=item.EnrollmentID }) |
            @Html.ActionLink(“Delete”, “Delete”, new { id=item.EnrollmentID })
        </td>
    </tr>
}
</table>
iyi çalışmalar
Ramazan CESUR