Beispiel #1
0
        private static WFFormFieldValue GetPrefilledFieldValue(TaskFormField field)
        {
            switch (field.Item)
            {
            case KeywordsField keywordsField: return(keywordsField.PrefillValue);

            case TaskNumberField taskNumberField: return(taskNumberField.PrefillValue);

            case RoleField roleField: return(roleField.PrefillValue);

            case SubstitutionRuleField substitutionRuleField: return(substitutionRuleField.PrefillValue);

            case TaskDateTimeField taskDateTimeField: return(taskDateTimeField.PrefillValue);

            case TaskTextField taskTextField: return(taskTextField.PrefillValue);

            case UserField userField: return(userField.PrefillValue);

            default: return(null);
            }
        }
Beispiel #2
0
        private static WFFormFieldValue GetExampleFieldValue(TaskFormField field)
        {
            switch (field.Item)
            {
            case KeywordsField keywordsField:
                return(new WFFormFieldValue()
                {
                    Item = new DocumentIndexFieldKeywords()
                    {
                        Keyword = new List <string>()
                        {
                            "keyword 1"
                        }
                    },
                    ItemElementName = TranslateFromFormFieldType(keywordsField.FormFieldType)
                });

            case TaskNumberField taskNumberField:
                return(new WFFormFieldValue()
                {
                    Item = 1m,
                    ItemElementName = TranslateFromFormFieldType(taskNumberField.FormFieldType)
                });

            case RoleField roleField:
                return(new WFFormFieldValue()
                {
                    Item = roleField.IsMultiselect ? (object)new DocumentIndexFieldKeywords()
                    {
                        Keyword = new List <string>()
                        {
                            "role1", "role2"
                        }
                    } : "role",
                    ItemElementName = TranslateFromFormFieldType(roleField.FormFieldType)
                });

            case SubstitutionRuleField substitutionRuleField:
                return(new WFFormFieldValue()
                {
                    Item = substitutionRuleField.IsMultiselect ? (object)new DocumentIndexFieldKeywords()
                    {
                        Keyword = new List <string>()
                        {
                            "substitutionRule1", "substitutionRule2"
                        }
                    } : "substitutionRule",
                    ItemElementName = TranslateFromFormFieldType(substitutionRuleField.FormFieldType)
                });

            case TaskDateTimeField taskDateTimeField:
                return(new WFFormFieldValue()
                {
                    Item = new DateTime(),
                    ItemElementName = TranslateFromFormFieldType(taskDateTimeField.FormFieldType)
                });

            case TaskTextField taskTextField:
                return(new WFFormFieldValue()
                {
                    Item = "text field",
                    ItemElementName = TranslateFromFormFieldType(taskTextField.FormFieldType)
                });

            case UserField userField:
                return(new WFFormFieldValue()
                {
                    Item = userField.IsMultiselect ? (object)new DocumentIndexFieldKeywords()
                    {
                        Keyword = new List <string>()
                        {
                            "user1", "user2"
                        }
                    } : "user",
                    ItemElementName = TranslateFromFormFieldType(userField.FormFieldType)
                });

            default: return(null);
            }
        }