@using GreenTree.Nachtragsmanagement.Web.Extensions @model GreenTree.Nachtragsmanagement.Web.Models.Config.ConfigItemDataModel
@Html.DevExpress().PopupControl(s => { s.Name = "devPopupControlEditConfigItem"; if (Model.Id == -1) s.HeaderText = "Neue Einstellung erstellen"; else { if (Model.Name.Length > 40) s.HeaderText = "\"" + Model.Name.Substring(0, 15) + " ... " + Model.Name.Substring(Model.Name.Length - 15, 15) + "\" bearbeiten"; } s.Modal = true; s.Width = new Unit(500, UnitType.Pixel); s.CloseAction = CloseAction.CloseButton; s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter; s.PopupVerticalAlign = PopupVerticalAlign.TopSides; s.PopupVerticalOffset = 20; s.AllowDragging = false; s.AllowResize = false; s.ShowFooter = false; s.ShowOnPageLoad = true; s.SetContent(() => { using (Html.BeginForm("EditConfigItem", "Deviation", FormMethod.Post, new { id = "configItemEditForm" })) { ViewContext.Writer.Write("
"); ViewContext.Writer.Write(""); ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Name, "Name:")); ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Name).ToHtmlString()); Html.DevExpress().TextBoxFor(m => m.Name, t => { t.Width = new Unit(100, UnitType.Percentage); }).Render(); ViewContext.Writer.Write(Html.CustomLabelFor(m => m.TypeFullName, "Datentyp:")); ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.TypeFullName).ToHtmlString()); Html.DevExpress().ComboBoxFor(m => m.TypeFullName, t => { t.Width = new Unit(60, UnitType.Percentage); t.Properties.Items.AddRange( GreenTree.Nachtragsmanagement.Web.Models.Config.ConfigItemDataModel.FullTypeTranslations .Select(f => new ListEditItem(f.Value, f.Key)) .ToList()); t.Properties.ClientSideEvents.SelectedIndexChanged = "function (s, e) { getValueTypePartialEdit(); }"; }).Render(); ViewContext.Writer.Write("
"); { ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Value, "Wert:")); ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Value).ToHtmlString()); Html.RenderPartial("~/Views/Config/_ConfigItemValueEditPartial.cshtml", Model); } ViewContext.Writer.Write("
"); ViewContext.Writer.Write(Html.CustomLabelFor(m => m.Description, "Beschreibung:")); ViewContext.Writer.Write(Html.ValidationMessageFor(m => m.Description).ToHtmlString()); Html.DevExpress().MemoFor(m => m.Description, t => { t.Width = new Unit(100, UnitType.Percentage); t.Height = new Unit(80, UnitType.Pixel); }).Render(); ViewContext.Writer.Write("
"); Html.RenderPartial( "~/Views/Shared/_PopupButtonPanel.cshtml", new GreenTree.Nachtragsmanagement.Web.Models.Global.PopupModel { PopupName = "devPopupControlEditConfigItem", AcceptFunction = "function (s, e) { saveConfigItem(); }" } ); } }); s.Styles.Content.Paddings.Padding = new Unit(0); s.Styles.ModalBackground.Opacity = 0; }).GetHtml()