_DisturbanceValueEdit.cshtml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. @using GreenTree.Nachtragsmanagement.Web.Extensions
  2. @model GreenTree.Nachtragsmanagement.Web.Models.Deviation.DeviationDataModel
  3. @Html.DevExpress().PopupControl(s =>
  4. {
  5. s.Name = "devDisturbanceValuePopup";
  6. s.HeaderText = "Kategorie zuweisen";
  7. s.Modal = true;
  8. s.Width = new Unit(350, UnitType.Pixel);
  9. s.CloseAction = CloseAction.CloseButton;
  10. s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
  11. s.PopupVerticalAlign = PopupVerticalAlign.TopSides;
  12. s.PopupVerticalOffset = 40;
  13. s.AllowDragging = true;
  14. s.AllowResize = false;
  15. s.ShowFooter = false;
  16. s.SetContent(() =>
  17. {
  18. ViewContext.Writer.Write("<div class='editFormWrapper'>");
  19. {
  20. ViewContext.Writer.Write(Html.CustomLabelFor(m => m.DisturbanceEntities, "Kategorie:"));
  21. Html.DevExpress().DropDownEdit(t =>
  22. {
  23. t.Name = "devDropDownListAllDisturbances";
  24. t.Width = new Unit(100, UnitType.Percentage);
  25. t.SetDropDownWindowTemplateContent(l =>
  26. {
  27. Html.DevExpress().ListBox(lb =>
  28. {
  29. lb.Name = "devListBoxAllDisturbances";
  30. lb.Width = new Unit(100, UnitType.Percentage);
  31. lb.Properties.TextField = "Description";
  32. lb.Properties.ValueField = "Id";
  33. lb.Properties.ValueType = typeof(int);
  34. lb.Properties.SelectionMode = ListEditSelectionMode.Single;
  35. lb.Properties.ClientSideEvents.SelectedIndexChanged = "function (s, e) { devDropDownListAllDisturbances.SetText(s.GetSelectedItem().text); devDropDownListAllDisturbances.HideDropDown(); }";
  36. lb.ControlStyle.Border.BorderStyle = BorderStyle.None;
  37. }).BindList(ViewData["AllDisturbances"]).Render();
  38. });
  39. }).Render();
  40. ViewContext.Writer.Write(Html.CustomLabelFor(m => m.DisturbanceEntities, "Wert:"));
  41. Html.DevExpress().SpinEdit(t =>
  42. {
  43. t.Name = "devSpinEditDisturbanceValue";
  44. t.Properties.MinValue = 0;
  45. t.Properties.DisplayFormatString = "c2";
  46. }).Render();
  47. }
  48. ViewContext.Writer.Write("</div>");
  49. Html.RenderPartial(
  50. "~/Views/Shared/_PopupButtonPanel.cshtml",
  51. new GreenTree.Nachtragsmanagement.Web.Models.Global.PopupModel
  52. {
  53. PopupName = "devDisturbanceValuePopup",
  54. AcceptFunction = "function (s, e) { addDisturbanceValue(); }"
  55. }
  56. );
  57. });
  58. s.Styles.Content.Paddings.Padding = new Unit(0);
  59. s.Styles.ModalBackground.Opacity = 0;
  60. }).GetHtml()