소스 검색

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