Esempio n. 1
0
        public TableField(Table table, string name, string description)
            : base(name, description)
        {
            if (null == table) throw new ArgumentNullException("table");

            this.Table = table;
        }
Esempio n. 2
0
        public void ToSql(StringBuilder builder, Table primaryTable, List<Table> skip)
        {
            if (null == builder) throw new ArgumentNullException("builder");

            if (null != this.MasterTable && !String.IsNullOrEmpty(this.MasterTable.Name) &&
                null != this.MasterField && !String.IsNullOrEmpty(this.MasterField.Name) &&
                null != this.DetailsTable && !String.IsNullOrEmpty(this.DetailsTable.Name) &&
                null != this.DetailsField && !String.IsNullOrEmpty(this.DetailsField.Name))
            {
                Table table = null;
                if (!skip.Contains(this.MasterTable) && primaryTable != this.MasterTable)
                    table = this.MasterTable;
                if (null == table && !skip.Contains(this.DetailsTable) && primaryTable != this.DetailsTable)
                    table = this.DetailsTable;
                if (null != table)
                {
                    builder.Append("    ");
                    builder.AppendFormat("left join [{0}] on ", table.Name);
                    this.MasterField.ToSql(builder, this.MasterField.Alias);
                    builder.Append(" = ");
                    this.DetailsField.ToSql(builder, this.DetailsField.Alias);
                }
            }
        }
Esempio n. 3
0
 public TableField(Table table, string name, string description, string dbtype, bool isPrimaryKey)
     : this(table, name, description, dbtype)
 {
     this.IsPrimaryKey = isPrimaryKey;
 }
Esempio n. 4
0
 public TableField(Table table, string name, string description, string dbtype)
     : this(table, name, description)
 {
     this.DBType = dbtype;
 }