@using EnVisage.Code @using EnVisage.Code.HtmlHelpers @using EnVisage.Models @model ScenarioModel @{ ViewBag.Title = Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add New Scenario"; } @section Scripts { }
@using (Html.BeginForm("Edit", "Scenarios", FormMethod.Post, new { @class = "panel form-horizontal", @id = "frmEditScenario" })) { @Html.AntiForgeryToken() @Html.HiddenFor(t => t.Id) @Html.HiddenFor(t => t.ParentId) @Html.HiddenFor(t => t.BUDirectCosts) @Html.HiddenFor(t => t.IsRevenueGenerating) @Html.HiddenFor(t => t.StartDateDisabled) @Html.HiddenFor(t => t.BackUrl) @Html.HiddenFor(t => t.BackName) @Html.HiddenFor(t => t.AsDraft) @Html.HiddenFor(t => t.Status)
Scenario Information
@Html.LabelFor(model => model.Name, new { @class = "col-sm-3 control-label" })
@Html.TextBoxFor(model => model.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Name)
@Html.LabelFor(model => model.Color, new { @class = "col-sm-3 control-label" })
@Html.TextBoxFor(model => model.Color, new { @class = "form-control input-color" }) @Html.ValidationMessageFor(model => model.Color)
@Html.LabelFor(model => model.Type, new { @class = "col-sm-3 control-label" })
@Html.DropDownListFor(model => model.Type, Utils.GetScenarioTypes4Wizard(), new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Type)
@Html.LabelFor(model => model.TemplateId, new { @class = "col-sm-3 control-label" })
@if (Model.Id == Guid.Empty || ScenarioStatus.Draft.Equals(Model.Status)) { @Html.DropDownListFor(model => model.TemplateId, Utils.GetScenarioTemplates(ScenarioStatus.Draft.Equals(Model.Status)), new { @class = "form-control" }) } else { @Html.DropDownListFor(model => model.TemplateId, Utils.GetScenarioTemplates(ScenarioStatus.Draft.Equals(Model.Status)), new { @class = "form-control", @disabled = "disabled" }) } @Html.ValidationMessageFor(model => model.TemplateId)
@if (Model.Id == Guid.Empty || ScenarioStatus.Draft.Equals(Model.Status)) {
@Html.LabelFor(model => model.IsActiveScenario, new { @class = "col-sm-3 control-label" })
@Html.CheckBoxFor(model => model.IsActiveScenario)
@Html.ValidationMessageFor(model => model.IsActiveScenario)
}
@Html.LabelFor(model => model.UseActuals, new { @class = "col-sm-3 control-label" })
@if (!Model.GrowthScenario) { @Html.CheckBoxFor(model => model.UseActuals) } else { @Html.CheckBoxFor(model => model.UseActuals, new { @disabled = "disabled" }) (Actuals cannot be used in Growth Scenarios) }
@Html.ValidationMessageFor(model => model.UseActuals)
@if (Model.Id != Guid.Empty && !ScenarioStatus.Draft.Equals(Model.Status)) {
@Html.LabelFor(model => model.AllowAdjustment, new { @class = "col-sm-3 control-label" })
@Html.CheckBoxFor(model => model.AllowAdjustment)
@Html.ValidationMessageFor(model => model.AllowAdjustment)
@Html.LabelFor(model => model.PriorWeekCutOff, new { @class = "col-sm-3 control-label" })
@Html.EditorFor(t => t.PriorWeekCutOff) @Html.ValidationMessageFor(model => model.PriorWeekCutOff)
}
@Html.EditorFor(t => t.StartDate, new { @class = "form-control" })
to
@Html.EditorFor(model => model.EndDate, new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.StartDate) @Html.ValidationMessageFor(model => model.EndDate)
@Html.LabelFor(model => model.MilestoneStartDate, new { @class = "col-sm-3 control-label" })
@Html.EditorFor(t => t.MilestoneStartDate) @Html.ValidationMessageFor(model => model.MilestoneStartDate)
@Html.LabelFor(model => model.GrowthScenario, new { @class = "col-sm-3 control-label" })
@Html.CheckBoxFor(model => model.GrowthScenario)
@Html.ValidationMessageFor(model => model.GrowthScenario)
@Html.LabelFor(model => model.TotalMilestones, new { @class = "col-sm-3 control-label" })
@Html.TextBoxFor(model => model.TotalMilestones, new { @class = "form-control", @style = "width:178px;" }) @Html.ValidationMessageFor(model => model.TotalMilestones)
Financial Information @if (!Model.IsRevenueGenerating) {
$ @Html.TextBoxFor(model => model.TDDirectCosts, new { @class = "form-control", @style = "width:138px;" }, Model.IsRevenueGenerating)
@Html.ValidationMessageFor(model => model.TDDirectCosts)
}
@Html.LabelFor(model => model.ProjectedRevenue, new { @class = "col-sm-3 control-label" })
$ @Html.TextBoxFor(model => model.ProjectedRevenue, new { @class = "form-control", @onchange = "RecalcExpense(this);", @style = "width:138px;" }, !Model.IsRevenueGenerating)
@Html.ValidationMessageFor(model => model.ProjectedRevenue)
@Html.LabelFor(model => model.GrossMargin, new { @class = "col-sm-3 control-label" })
@Html.TextBoxFor(model => model.GrossMargin, new { @class = "form-control", @onchange = "RecalcExpense(this);" }, Model.UseLMMargin || !Model.IsRevenueGenerating) %
@Html.ValidationMessageFor(model => model.GrossMargin)
@Html.LabelFor(model => model.LMMargin, new { @class = "col-sm-3 control-label" })
@Html.TextBoxFor(model => model.LMMargin, new { @class = "form-control", @onchange = "RecalcExpense(this);" }, !Model.UseLMMargin || !Model.IsRevenueGenerating) %
@Html.ValidationMessageFor(model => model.LMMargin)
@if (Model.Id != Guid.Empty && !ScenarioStatus.Draft.Equals(Model.Status)) {
@Html.LabelFor(model => model.FreezeResource, new { @class = "col-sm-3 control-label" })
@Html.ValidationMessageFor(model => model.FreezeResource)
} @*
@Html.LabelFor(model => model.LaborSplitPercentage, new { @class = "col-sm-3 control-label" })
@Html.EditorFor(model => model.LaborSplitPercentage) @Html.ValidationMessageFor(model => model.LaborSplitPercentage)
*@
Expenditure Categories
@Html.Partial("_expenditures", Model.Expenditures)
@Html.ValidationSummary(false, "The Scenario could not be saved due to the following errors:")
@if (Model.Id != Guid.Empty) { Back to scenario } else { Back to projects } @if (Guid.Empty.Equals(Model.Id)) { } @if (Model.Id != Guid.Empty) { if (Model.ChildScenarios > 0) { Delete } else { Delete } }
}