_DisturbanceValueEditPartial.cshtml 2.5 KB

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