@model EnVisage.Models.ViewModel @using EnVisage.Code @{ ViewBag.Title = Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add View"; var teams = string.Join("','", Model.Teams ?? new List()); teams = "'" + teams + "'"; var watchers = string.Join("','", Model.Watchers ?? new List()); watchers = "'" + watchers + "'"; } @section Scripts { }
@using (Html.BeginForm("Edit", "View", FormMethod.Post, new { @class = "panel form-horizontal" })) { @Html.AntiForgeryToken() @Html.HiddenFor(t => t.Id) @Html.HiddenFor(t => t.backController) @Html.HiddenFor(t => t.backAction)
@*
*@ @(Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add View")
@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.Teams, new { @class = "control-label" }) @Html.EditorFor(model => model.Teams, string.Empty, new { List = Utils.GetTeamsAvailableForUser(Guid.Parse(User.Identity.GetID())) }) @Html.ValidationMessageFor(model => model.Watchers)
@Html.LabelFor(model => model.Watchers, new { @class = "control-label" }) @Html.EditorFor(model => model.Watchers, string.Empty, new { List = Model.AvailableUsers.Select(x => new SelectListItem() { Value = x.Id.ToString(), Text = x.UserName }).ToList() }) @Html.ValidationMessageFor(model => model.Watchers)
@Html.ValidationSummary(false, "The View could not be saved due to the following errors:")
Back to list @if (Model != null && Model.Id != Guid.Empty) { if (Model.TeamCount > 0) { Delete } else { Delete } }
 
 
}