@using EnVisage.Code @using EnVisage.Models @using Microsoft.AspNet.Identity @model EnVisage.Models.CreateScenarioModel.GeneralInfoModel @{ var user = (new EnVisage.Code.Cache.UsersCache()).Value.FirstOrDefault(x => x.Id == new Guid(User.Identity.GetID())); var calendarModel = (new ScenarioDetailsCalendarModel(Model, user, ScenarioDetailsCalendarModel.ScenarioCalendarOpener.CreateScenarioWizard)); var json = Newtonsoft.Json.JsonConvert.SerializeObject(calendarModel); } @using (Ajax.BeginForm("SubmitCreateScenarioStep1", "Scenarios", new AjaxOptions { HttpMethod = "Post", OnSuccess = "onStep1Success", OnFailure = "onStep1Failure(xhr)", UpdateTargetId = "generalStep" }, new { @id = "generalStepForm", @class = "form-horizontal", })) { @Html.HiddenFor(m => m.ScenarioId) @Html.HiddenFor(m => m.ProjectId) @Html.HiddenFor(m => m.PartId) @Html.HiddenFor(m => m.ProjectDeadline) @Html.HiddenFor(m => m.StatusIsEditable) @Html.Hidden("general-step-selected-expenditure-categories", Model.ScenarioExpenditures == null ? "" : Newtonsoft.Json.JsonConvert.SerializeObject(Model.ScenarioExpenditures.Where(x => x.Checked).Select(x => x.Id)), new { @id = "general-step-selected-expenditure-categories" }) @Html.HiddenFor(m => m.SerializedModel) @Html.AntiForgeryToken()
Scenario Information
@Html.LabelFor(model => model.ProjectId, new { @class = "control-label" }) @Html.DropDownListFor(model => model.ProjectId, Utils.GetProjects(new Guid(User.Identity.GetID())), new { @class = "form-control", @id = "projects", @disabled = "disabled" }) @Html.ValidationMessageFor(model => model.ProjectId)
@Html.LabelFor(model => model.PartId, new { @class = "control-label" }) @Html.DropDownListFor(model => model.PartId, Utils.GetProjectParts(Model.ProjectId, new Guid(User.Identity.GetID())), new { @class = "form-control", @id = "partNames", @disabled = "disabled" }) @Html.ValidationMessageFor(model => model.PartId)
@Html.LabelFor(model => model.ScenarioName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ScenarioName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ScenarioName)
@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()) }
@Html.LabelFor(model => model.TemplateId, new { @class = "control-label" }) @Html.DropDownListFor(model => model.TemplateId, new List(), new { @class = "form-control forselect2", @onchange = "$(this).parents('form').validate().element($(this)); reloadEC(false);" }) @Html.ValidationMessageFor(model => model.TemplateId)
@Html.LabelFor(model => model.CreateAsActive, new { @class = "control-label" }) @Html.CheckBoxFor(model => model.CreateAsActive, new { @class = "switcher form-control yes-no-switcher" }) @Html.ValidationMessageFor(model => model.CreateAsActive)
Expenditure Categories
Teams
@Html.EditorFor(x => x.Teams)
@Html.ValidationSummary(false, "The scenario could not be saved due to the following errors:") }