@using EnVisage.Code @using EnVisage.Code.HtmlHelpers @using EnVisage.Models @model EnVisage.Models.HolidayModel @{ ViewBag.Title = Model != null ? "Edit " + Model.Name + " Holiday" : "Add Holiday"; } @section Scripts { @if (Model != null) { } }
@if (Model != null) { } @using (Html.BeginForm("EditHoliday", "Calendar", FormMethod.Post, new { @class = "panel form-horizontal" })) { @Html.HiddenFor(t=>t.Id) @Html.AntiForgeryToken()
@Html.LabelFor(model => model.Name, new { @class = "col-sm-2 control-label" })
@Html.TextBoxFor(model => model.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Name)
@Html.LabelFor(model => model.OccurrenceType, new { @class = "col-sm-2 control-label" })
@Html.DropDownListFor(t => t.OccurrenceType, Utils.GetOccurrenceTypes(), new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.OccurrenceType)
@*@Html.LabelFor(model => model.OccurrenceWeekDay, new { @class = "col-sm-2 control-label" })*@
@Html.DropDownListFor(model => model.OccurrenceWeekDay, Utils.GetWeekDays(), new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.OccurrenceWeekDay)
@Html.DropDownListFor(model => model.OccurrenceMonthDay, Utils.GetMonthDays(Model.OccurrenceMonth ?? 1), new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.OccurrenceMonthDay)
of
@* @Html.LabelFor(model => model.OccurrenceMonth, new { @class = "col-sm-1 control-label" })*@
@Html.DropDownListFor(model => model.OccurrenceMonth, Utils.GetMonths(), new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.OccurrenceMonth)
@Html.LabelFor(model => model.WorkingDay, new { @class = "col-sm-2 control-label" })
@Html.EditorFor(model => model.WorkingDay, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.WorkingDay)
@Html.LabelFor(model => model.NonWorkingWeek, new { @class = "col-sm-2 control-label" })
@Html.EditorFor(model => model.NonWorkingWeek, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.NonWorkingWeek)
@Html.ValidationSummary(false, "The holiday could not be saved due to the following errors:")
}