@using EnVisage.Code.HtmlHelpers @model EnVisage.Models.VacationModel @{ ViewBag.Title = (Model != null && !Guid.Empty.Equals(Model.Id) ? "Edit " : "Add ") + " Vacation"; var weekEndsStr = string.Empty; foreach (var dateTime in Model.Weekends) { if (!string.IsNullOrEmpty(weekEndsStr)) { weekEndsStr += ","; } weekEndsStr += "'" + dateTime.ToShortDateString() + "'"; } } @section Scripts { }
@using (Html.BeginForm("EditVacation", "PeopleResource", FormMethod.Post, new { @class = "panel form-horizontal" })) { @Html.AntiForgeryToken() @Html.HiddenFor(t => t.Id) @Html.HiddenFor(t => t.PeopleResourceId) @Html.HiddenFor(t=>t.UOMValue) @Html.HiddenFor(t=>t.WeekendingDay)
@Html.LabelFor(model => model.StartDate, new { @class = "col-sm-3 control-label" })
@Html.EditorFor(model => model.StartDate, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.StartDate)
@Html.LabelFor(model => model.EndDate, new { @class = "col-sm-3 control-label" })
@Html.EditorFor(model => model.EndDate, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.EndDate)
days
@Html.LabelFor(model => model.HoursOff, new { @class = "col-sm-3 control-label" })
@Html.EditorFor(model => model.HoursOff) @Html.ValidationMessageFor(model => model.HoursOff)
@Html.LabelFor(model => model.Weekends, new { @class = "col-sm-3 control-label" })
@Html.EditorFor(model => model.Weekends) @Html.ValidationMessageFor(model => model.Weekends)

Make sure you select weekend days for the whole weeks but not only within vacation's date range.

@Html.ValidationSummary(false, "The client could not be saved due to the following errors:")
Back to list @if (Model != null && !Guid.Empty.Equals(Model.Id)) { Delete }
}