瀏覽代碼

Added better formatters for ProductTreatment lookups

Kenric Nugteren 1 年之前
父節點
當前提交
1fe186d9d0
共有 2 個文件被更改,包括 19 次插入0 次删除
  1. 9 0
      prs.classes/Entities/Product/Product.cs
  2. 10 0
      prs.classes/Entities/Product/Treatment/ProductTreatment.cs

+ 9 - 0
prs.classes/Entities/Product/Product.cs

@@ -205,6 +205,15 @@ namespace Comal.Classes
             {
                 return new Filter<TreatmentType>(x => x.Active).IsEqualTo(true);
             }
+
+            public override Columns<TreatmentType> DefineColumns()
+            {
+                return base.DefineColumns().Add(x => x.Description);
+            }
+            public override string FormatDisplay(CoreRow row)
+            {
+                return row.Get<TreatmentType, string>(x => x.Description);
+            }
         }
         [LookupDefinition(typeof(TreatmentTypeLookup))]
         [EditorSequence("Warehousing", 6)]

+ 10 - 0
prs.classes/Entities/Product/Treatment/ProductTreatment.cs

@@ -31,6 +31,16 @@ namespace Comal.Classes
             {
                 return Columns.None<ProductTreatment>().Add(x => x.Product.ID).Add(x => x.TreatmentType.ID);
             }
+
+            public override Columns<TreatmentType> DefineColumns()
+            {
+                return base.DefineColumns().Add(x => x.Description);
+            }
+
+            public override string FormatDisplay(CoreRow row)
+            {
+                return row.Get<TreatmentType, string>(x => x.Description);
+            }
         }
         [EditorSequence(1)]
         [LookupDefinition(typeof(TreatmentTypeLookup))]