@using EnVisage.Code @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.HiddenFor(t=>t.ParentViewId)
@Html.EditorFor(t => t.StartDate)
to
@Html.EditorFor(model => model.EndDate)
@Html.ValidationMessageFor(model => model.StartDate) @Html.ValidationMessageFor(model => model.EndDate)
@*
@Html.EditorFor(t => t.StartDate)
to
@Html.EditorFor(model => model.EndDate)
@Html.ValidationMessageFor(model => model.StartDate) @Html.ValidationMessageFor(model => model.EndDate) @if (Model.ProjectDeadline != null) { (Project Deadline: @Model.ProjectDeadline.Value.ToShortDateString()) }
*@
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 }
}