_CategoryValueEditPartial.cshtml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. @using GreenTree.Nachtragsmanagement.Web.Extensions
  2. @using GreenTree.Nachtragsmanagement.Core.Domain.Appendix
  3. @model GreenTree.Nachtragsmanagement.Web.Models.Appendix.AppendixDataModel
  4. @Html.DevExpress().PopupControl(s =>
  5. {
  6. s.Name = "devCategoryValuePopup";
  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.CategoryEntities, "Kategorie:"));
  22. Html.DevExpress().DropDownEdit(t =>
  23. {
  24. t.Name = "devDropDownListAllCategories";
  25. t.Width = new Unit(100, UnitType.Percentage);
  26. t.Text = ((ICollection<Category>)ViewData["AllCategories"]).ToArray()[0].Description;
  27. t.SetDropDownWindowTemplateContent(l =>
  28. {
  29. Html.DevExpress().ListBox(lb =>
  30. {
  31. lb.Name = "devListBoxAllCategories";
  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) { devDropDownListAllCategories.SetText(s.GetSelectedItem().text); devDropDownListAllCategories.HideDropDown(); }";
  39. lb.ControlStyle.Border.BorderStyle = BorderStyle.None;
  40. }).BindList(ViewData["AllCategories"]).Render();
  41. });
  42. }).Render();
  43. ViewContext.Writer.Write(Html.CustomLabelFor(m => m.CategoryEntities, "Wert:"));
  44. Html.DevExpress().SpinEdit(t =>
  45. {
  46. t.Name = "devSpinEditCategoryValue";
  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 = "devCategoryValuePopup",
  60. AcceptFunction = "function (s, e) { addCategoryValue(); }"
  61. }
  62. );
  63. });
  64. s.Styles.Content.Paddings.Padding = new Unit(0);
  65. s.Styles.ModalBackground.Opacity = 0;
  66. }).GetHtml()