@model EnVisage.Models.TeamModel @using EnVisage.Code.HtmlHelpers @using EnVisage.Code @{ ViewBag.Title = Model != null ? "Edit " + Model.Name : "Add Team"; var contributors = string.Join("','", Model.UserId); contributors = "'" + contributors + "'"; } @section Scripts { @if (Model != null) { } }
@using (Html.BeginForm("Edit", "Team", FormMethod.Post, new { @class = "panel form-horizontal" })) { @Html.AntiForgeryToken()
@(Model != null ? "Edit " + Model.Name : "Add Team")
@Html.LabelFor(model => model.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Name)
@Html.LabelFor(model => model.ReportToId, new { @class = "control-label" }) @Html.DropDownListFor(model => model.ReportToId, Utils.GetTeamContacts(Model.CompanyId), new { @class = "form-control forselect2" }) @Html.ValidationMessageFor(model => model.ReportToId)
@Html.LabelFor(model => model.CostCenterId, new { @class = "control-label" }) @Html.DropDownListFor(model => model.CostCenterId, Utils.GetCreditDepartments(), new { @class = "form-control forselect2" }) @Html.ValidationMessageFor(model => model.CostCenterId)
@Html.LabelFor(model => model.CompanyId, new { @class = "control-label" }) @Html.DropDownListFor(model => model.CompanyId, Utils.GetCompanies(), new { @class = "form-control forselect2" }) @Html.ValidationMessageFor(model => model.CompanyId)
@Html.LabelFor(model => model.UserId, new { @class = "control-label" }) @Html.EditorFor(model => model.UserId, string.Empty, new { List = Model.Users.OrderBy(x=>x.LastName).Select(x => new SelectListItem() { Value = x.Id.ToString(), Text = x.FirstName }).ToList() }) @Html.ValidationMessageFor(model => model.UserId)
@Html.ValidationSummary(false, "The user could not be saved due to the following errors:")
Back to list @if (Model != null) { @*if (Model.Projects.Count > 0) { Delete } else { *@ Delete //} }
@if (Model != null) { Html.HiddenFor(model => model.Id); } @Html.HiddenFor(model => model.ActualCapacityScenarioId); @Html.HiddenFor(model => model.PlannedCapacityScenarioId);
}