Преглед изворни кода

Added better formatters for ProductTreatment lookups

Kenric Nugteren пре 1 година
родитељ
комит
1fe186d9d0

+ 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))]