Exemplo n.º 1
0
 private static void PopulateMetadataForUpload(ModelForm modelForm, FieldForm fieldForm)
 {
     if (fieldForm.Type == "Upload")
     {
         modelForm.ContainsFile = true;
     }
 }
Exemplo n.º 2
0
        private static void PopulateMetadataForFieldSelect(ModelForm modelForm, FieldForm fieldForm, IProperty item)
        {
            if (fieldForm.Type == "select" && item.IsForeignKey())
            {
                IForeignKey foreignKey    = item.GetContainingForeignKeys().First();
                var         declaringType = foreignKey.PrincipalKey.DeclaringEntityType;

                fieldForm.ForeignEntityName = declaringType.ClrType.Name;
                fieldForm.IsForeingKey      = true;
                fieldForm.IsCollection      = foreignKey.DependentToPrincipal.IsCollection();
                modelForm.DependentToPrincipalFields.Add(fieldForm);
            }
            else if (fieldForm.Type == "select" && item.ClrType.IsEnum == true)
            {
                Enum.GetNames(item.GetType());
            }
        }