Example #1
0
        private static void BuildField(MetadataColumn col, string TableName, string Alias, FormSection section, MetadataColumn IncludeFrom, bool ForceReadOnly = false)
        {
            if (col.IsRowGuid)
            {
                return;
            }
            FormField field = null;

            if (col.IsForeignKey)
            {
                field = new LookupFormField()
                {
                    LookupSource = LookupSources.SqlBuilder,
                    Builder      = col.ToSqlBuilder()
                };
            }
            else
            {
                field = new FormField();
            }


            field.DisplayName = (IncludeFrom != null ? IncludeFrom.DisplayName + " " : "") + col.DisplayName;
            field.ID          = col.Name;
            field.Name        = col.Name;
            field.Alias       = Alias;
            field.TableName   = TableName;
            field.NullText    = "Enter " + col.Name;
            field.IsReadOnly  = ForceReadOnly || col.IsReadOnly || col.IsPrimaryKey;
            field.IsRequired  = !col.Nullable;
            ResolveFieldType(col, field);
            section.Fields.Add(field);
        }
Example #2
0
        private static void BuildField(MetadataColumn col, string TableName, string Alias, FormSection section, MetadataColumn IncludeFrom, bool ForceReadOnly = false)
        {
            if (col.IsRowGuid)
            {
                return;
            }
            FormField field = null;

            if (col.IsForeignKey)
            {
                field = new LookupFormField()
                {
                    LookupSource = LookupSources.SqlBuilder,
                    Builder = col.ToSqlBuilder()
                };
            }
            else
            {
                field = new FormField();
            }


            field.DisplayName = (IncludeFrom != null ? IncludeFrom.DisplayName + " " : "") + col.DisplayName;
            field.ID = col.Name;
            field.Name = col.Name;
            field.Alias = Alias;
            field.TableName = TableName;
            field.NullText = "Enter " + col.Name;
            field.IsReadOnly = ForceReadOnly || col.IsReadOnly || col.IsPrimaryKey;
            field.IsRequired = !col.Nullable;
            ResolveFieldType(col, field);
            section.Fields.Add(field);
        }