@using EnVisage.Code @using EnVisage.Models @model ScenarioDetailModel @{ ViewBag.Title = (!string.IsNullOrEmpty(Model.PartName) ? Model.PartName + ": " : "") + Model.ProjectName + " Scenario Details" + (string.IsNullOrEmpty(Model.Name) ? "" : " - " + Model.Name); var userId = SecurityManager.GetUserPrincipal(); var scenarioUIManager = DependencyResolver.Current.GetService(); var detailsModel = scenarioUIManager.CreateScenarioDetailsCalendarModel(userId, Model, ScenarioDetailsCalendarModel.ScenarioCalendarOpener.Details); // need to init angular header controller var jsmodel =new { id = Model.Id, name = Model.Name, parentId = Model.ParentId, templateId = Model.TemplateId.Equals(Guid.Empty) ? (Guid?)null : Model.TemplateId, startDate = (Model.StartDate ?? DateTime.Today).ToString("MM/dd/yyyy"), endDate = (Model.EndDate ?? DateTime.Today).ToString("MM/dd/yyyy"), growthScenario = Model.GrowthScenario, expense = Model.FinInfo.TDDirectCosts, revenue = Model.FinInfo.ProjectedRevenue ?? 0, useLMMargin = Model.FinInfo.UseLMMargin, grossMargin = Model.FinInfo.GrossMargin ?? 0, lmMargin = Model.FinInfo.LMMargin ?? 0, isActiveScenario = Model.IsActiveScenario, isBottomUp = Model.IsBottomUp, duration = Model.Duration, dateForStartOfChanges = Model.FinInfo.DateForStartOfChanges.HasValue ? Model.FinInfo.DateForStartOfChanges.Value.ToString("MM/dd/yyyy") : string.Empty, activeTab = Model.ActiveTab, Model.UserDefinedFields, DeadlineDate = Model.ProjectDeadline.HasValue ? Model.ProjectDeadline.Value.ToString("MM/dd/yyyy") : null, projectHasDependencies = Model.ProjectHasDependencies, startDateConstraint = Model.StartDateConstraintMs, endDateConstraint = Model.EndDateConstraintMs, workflowScheme = Model.WorkFlowScheme }; var json = Newtonsoft.Json.JsonConvert.SerializeObject(jsmodel); } @section stylesheets { @Styles.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_STYLES_BASE_PATH, "prevu-scenariodetailsstyles")) } @section Scripts { @Scripts.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_SCRIPTS_BASE_PATH, "flot-scripts")) @Scripts.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_SCRIPTS_BASE_PATH, "prevu-angularservices")) @Scripts.Render(String.Format("{0}/{1}", Constants.C_BUNDLE_SCRIPTS_BASE_PATH, "prevu-scenariodetails")) }
Scenario dates violate project's dependencies date constraints
@Html.HiddenFor(t => t.Id) @Html.HiddenFor(t => t.ParentId) @Html.HiddenFor(t => t.BackUrl) @Html.HiddenFor(t => t.BackName)
Scenario Information @Html.CheckBoxFor(model => model.IsActiveScenario, new { @class = "form-control", ng_model = "changedData.isActiveScenario", ng_change = "modelChanged()" })

@Html.LabelFor(model => model.ProjectName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ProjectName, new { @class = "form-control", @readonly = "readonly" })
@if (!string.IsNullOrWhiteSpace(Model.PartName)) {
@Html.LabelFor(model => model.PartName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.PartName, new { @class = "form-control", @readonly = "readonly" })
}
@Html.LabelFor(model => model.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Name, new { @class = "form-control", ng_model = "changedData.name", ng_change = "modelChanged()" }) @Html.ValidationMessageFor(model => model.Name)
@Html.TextBoxFor(x => x.StartDate, new { @class = "form-control", ng_model = "changedData.startDate", ng_change = "modelChanged()", ng_model_options = "{ updateOn: 'change' }" })
to
@Html.TextBoxFor(x => x.EndDate, new { @class = "form-control", ng_model = "changedData.endDate", ng_change = "modelChanged()", ng_model_options = "{ updateOn: 'change' }" })
@Html.ValidationMessageFor(model => model.StartDate) @Html.ValidationMessageFor(model => model.EndDate) @if (Model.ProjectDeadline.HasValue) {
@Html.LabelFor(x => x.ProjectDeadline) @Html.DisplayFor(x => x.ProjectDeadline)
}
@Html.LabelFor(x => x.TemplateId, new { @class = "control-label" }) @Html.ValidationMessageFor(x => x.TemplateId)
@Html.LabelFor(x => x.IsBottomUp, new { @class = "control-label" })
@Html.CheckBoxFor(x => x.IsBottomUp, new { @class = "control-label" })
@Html.LabelFor(x => x.Duration, new { @class = "control-label" }) @Html.TextBoxFor(x => x.Duration, new { disabled = "disabled", @class = "form-control", ng_model = "changedData.duration" })
@{ IEnumerable workFlowList = Utils.GetWorkFlowSchemas(WorkFlowArea.Scenarios.GetHashCode(), new Guid(User.Identity.GetID())); if (workFlowList.Count() > 1) {
@Html.LabelFor(x => x.WorkFlowScheme, new { @class = "control-label" }) @Html.DropDownListFor(model => model.WorkFlowScheme, workFlowList, new { @class = "form-control forselect2", ng_model = "changedData.workflowScheme", ng_change = "modelChanged()" })
} }
@if (Model.WorkFlowState != null) {
@Html.LabelFor(x => x.WorkFlowState, new { @class = "control-label" }) @Html.TextBoxFor(x => x.WorkFlowState, new { disabled = "disabled", @class = "form-control" })
}
@Html.EditorFor(x => x.FinInfo) @if (Model.UserDefinedFields.Count > 0) {
@Resources.Labels.Common_UserDefinedFields
@Html.EditorFor(t => t.UserDefinedFields, new { @class = "form-control" })
} @Html.ValidationSummary(false, Resources.Messages.Scenario_Validation_Common, new { id = "header-val-summary" })
@Resources.Buttons.Common_BackTo_ @Model.BackName
@{ Html.RenderPartial("_scenarioCalendar", detailsModel); }
@Html.Partial("_rates", Model.RatesModel)
@Html.Partial("_notes", Model.Id)