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

Added Number Field to EntityForm Instances

Frank van den Bos пре 2 година
родитељ
комит
18d0d0adba
1 измењених фајлова са 16 додато и 1 уклоњено
  1. 16 1
      InABox.Core/DigitalForms/Forms/EntityForm.cs

+ 16 - 1
InABox.Core/DigitalForms/Forms/EntityForm.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Linq.Expressions;
 
 namespace InABox.Core
 {
@@ -10,12 +11,23 @@ namespace InABox.Core
     }
 
     [Caption("Digital Forms")]
-    public abstract class EntityForm<TParent, TParentLink> : Entity, IRemotable, IPersistent, ISequenceable,
+    public abstract class EntityForm<TParent, TParentLink> : Entity, IRemotable, IPersistent, ISequenceable, IStringAutoIncrement<EntityForm<TParent,TParentLink>>,
         IEntityForm,
         IDigitalFormInstance<TParentLink>, ILicense<DigitalFormsLicense>
         where TParent : Entity
         where TParentLink : IEntityLink<TParent>, new()
     {
+
+        public Expression<Func<EntityForm<TParent, TParentLink>, String>> AutoIncrementField() => x => x.Number;
+
+        public abstract string AutoIncrementFormat();
+        
+        public Filter<EntityForm<TParent, TParentLink>> AutoIncrementFilter() => null;
+        
+        [EditorSequence(1)]
+        [CodeEditor(Editable = Editable.Disabled)]
+        public String Number { get; set; }
+        
         [EditorSequence(2)]
         public string Description { get; set; }
 
@@ -96,5 +108,8 @@ namespace InABox.Core
             FormOpen = TimeSpan.Zero;
             Processed = false;
         }
+
+
+
     }
 }