_AppendixDeviationsPartial.cshtml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. @{
  2. var userContext = GreenTree.Nachtragsmanagement.Core.CommonHelper.UserContext();
  3. }
  4. <div style="width: 100%; overflow: auto; max-height: 380px; overflow-x: hidden">
  5. @Html.DevExpress().GridView(t =>
  6. {
  7. t.Name = "devGridViewAppendixDeviations";
  8. t.Width = Unit.Percentage(100);
  9. t.SettingsPager.Mode = GridViewPagerMode.ShowAllRecords;
  10. t.Columns.Add(column =>
  11. {
  12. column.FieldName = "CustomNumber";
  13. column.Caption = "#";
  14. column.CellStyle.Wrap = DefaultBoolean.True;
  15. });
  16. t.Columns.Add(column =>
  17. {
  18. column.FieldName = "Description";
  19. column.Caption = "Bezeichnung";
  20. column.CellStyle.Wrap = DefaultBoolean.True;
  21. });
  22. t.Columns.Add(column =>
  23. {
  24. column.Caption = "Eingang";
  25. column.FieldName = "ReceiptDate";
  26. column.PropertiesEdit.DisplayFormatString = "dd.MM.yyyy";
  27. });
  28. t.Columns.Add(column =>
  29. {
  30. column.Caption = "Bewertung";
  31. column.FieldName = "Value";
  32. column.PropertiesEdit.DisplayFormatString = "c2";
  33. column.Width = new Unit(100, UnitType.Pixel);
  34. });
  35. t.Columns.Add("KindDescription", "VA-Art");
  36. t.Columns.Add("StatusDescription", "Status");
  37. t.Columns.Add(column =>
  38. {
  39. column.FieldName = "DisturbanceValuesDescription";
  40. column.Caption = "Kategorien";
  41. column.CellStyle.Wrap = DefaultBoolean.True;
  42. column.Width = new Unit(170, UnitType.Pixel);
  43. });
  44. t.Columns.Add(column =>
  45. {
  46. column.Caption = "Kommentar";
  47. column.CellStyle.Wrap = DefaultBoolean.True;
  48. column.SetDataItemTemplateContent(c =>
  49. {
  50. var id = Convert.ToInt32(DataBinder.Eval(c.DataItem, "Id"));
  51. var comment = DataBinder.Eval(c.DataItem, "Comment");
  52. var text = comment == null
  53. ? String.Empty
  54. : comment.ToString();
  55. if (text.ToString().Length > 40)
  56. {
  57. ViewContext.Writer.Write(text.Substring(0, 40) + " ...");
  58. ViewContext.Writer.Write("<a href=\"#\" onclick='showComment(\"deviation\"," + id + ",this)'><br />Anzeigen</a>");
  59. }
  60. else
  61. ViewContext.Writer.Write(text);
  62. });
  63. });
  64. t.HtmlRowPrepared = (sender, e) =>
  65. {
  66. };
  67. t.Style.Add("box-shadow", "none");
  68. t.Styles.Cell.VerticalAlign = VerticalAlign.Top;
  69. t.Styles.Cell.Paddings.PaddingTop = new Unit(14, UnitType.Pixel);
  70. t.Styles.Cell.Paddings.PaddingBottom = new Unit(14, UnitType.Pixel);
  71. }).Bind(ViewData["AppendixDeviations"]).GetHtml()
  72. </div>