Exemplo n.º 1
0
 public DBColumnGroupList(DBTable table) : base(table)
 {
 }
Exemplo n.º 2
0
 public DBComparer(DBTable table, string column, ListSortDirection direction = ListSortDirection.Ascending)
     : this(table, table.ParseColumn(column), column, direction)
 {
 }
Exemplo n.º 3
0
 public override void Dispose()
 {
     Table = null;
     base.Dispose();
 }
Exemplo n.º 4
0
 public IEnumerable <DBColumn> GetByReference(DBTable table)
 {
     return(Select(DBColumn.ReferenceTableInvoker <T> .Instance, CompareType.Equal, table.Name));
 }
Exemplo n.º 5
0
 public DBTableView()
     : this(DBTable.GetTable <T>(null, false), (QParam)null, DBViewKeys.None, DBStatus.Empty)
 {
 }
Exemplo n.º 6
0
 public DBTableItemList(DBTable table) : base()
 {
     Table = table;
 }
Exemplo n.º 7
0
 public DBIndexList(DBTable table) : base(table)
 {
 }
Exemplo n.º 8
0
 public DBForeignList(DBTable table) : base(table)
 {
     Indexes.Add(DBForeignKey.ReferenceNameInvoker.Instance);
     Indexes.Add(DBForeignKey.ReferenceTableNameInvoker.Instance);
     Indexes.Add(DBForeignKey.PropertyInvoker.Instance);
 }
Exemplo n.º 9
0
 public DBForeignKey(DBColumn column, DBTable value) : this()
 {
     Column    = column;
     Reference = value.PrimaryKey;
 }
Exemplo n.º 10
0
 public override void FormatInsertSequence(StringBuilder command, DBTable table, DBItem row)
 {
     throw new NotSupportedException();
 }
Exemplo n.º 11
0
        public static DBCommand Build(DBTable table, string procName, DBCommandTypes type, IEnumerable <DBColumn> columns = null)
        {
            if (table.PrimaryKey == null && (type == DBCommandTypes.Delete || type == DBCommandTypes.Update))
            {
                return(null);
            }
            if (columns == null)
            {
                columns = table.Columns;
            }
            string commandText = procName;
            string prefix      = table.Schema.System.ParameterPrefix;

            CommandType ctype = CommandType.StoredProcedure;

            if (string.IsNullOrEmpty(procName))
            {
                ctype       = CommandType.Text;
                commandText = table.Schema.System.FormatCommand(table, type, null, columns);
            }
            var command = new DBCommand(commandText, ctype);

            if (type == DBCommandTypes.Delete)
            {
                command.Parameters.Add(new DBCommandParameter(table.PrimaryKey, prefix)
                {
                    Direction = ParameterDirection.Input
                });
            }
            else
            {
                DBCommandParameter paramId = null;
                if (table.PrimaryKey != null)
                {
                    paramId = new DBCommandParameter(table.PrimaryKey, prefix)
                    {
                        Direction = ParameterDirection.Input
                    };

                    if (type == DBCommandTypes.Insert || type == DBCommandTypes.InsertSequence)
                    {
                        command.Parameters.Add(paramId);
                    }
                    //else if (type == DBCommandTypes.InsertSequence)
                    //{
                    //command.Parameters.Add(paramId);
                    //paramId.Direction = ParameterDirection.InputOutput;
                    //}
                }
                foreach (var column in columns)
                {
                    if (column.ColumnType == DBColumnTypes.Default && column != table.PrimaryKey)
                    {
                        var prm = new DBCommandParameter(column, prefix);
                        if (ctype == CommandType.Text)
                        {
                            prm.Direction = ParameterDirection.Input;
                        }
                        command.Parameters.Add(prm);
                    }
                }
                if (paramId != null && type == DBCommandTypes.Update)
                {
                    command.Parameters.Add(paramId);
                }
            }
            return(command);
        }
Exemplo n.º 12
0
 public DBTableView(DBTable <T> table, string defaultFilter, DBViewKeys mode = DBViewKeys.None, DBStatus statusFilter = DBStatus.Empty)
     : this(table, !string.IsNullOrEmpty(defaultFilter) ? new QParam(table, defaultFilter) : null, mode, statusFilter)
 {
 }
Exemplo n.º 13
0
 public DBTableView(QParam defaultFilter, DBViewKeys mode = DBViewKeys.None, DBStatus statusFilter = DBStatus.Empty)
     : this(DBTable.GetTable <T>(null, false), defaultFilter, mode, statusFilter)
 {
 }
Exemplo n.º 14
0
 public QTable(DBTable table, string alias = null)
 {
     Table      = table;
     this.alias = alias;
 }
Exemplo n.º 15
0
 public override void Initialize(Type type)
 {
     BaseTable = DBTable.GetTableAttribute(BaseType);
     base.Initialize(type);
 }
Exemplo n.º 16
0
 public DBConstraintList(DBTable table) : base(table)
 {
     Indexes.Add(DBConstraintColumnNameInvoker <T> .Instance);
 }
Exemplo n.º 17
0
 public DBLogTable(DBTable table)
 {
     BaseTable = table;
 }
Exemplo n.º 18
0
 public IEnumerable <DBForeignKey> GetByReference(DBTable reference)
 {
     return(Select(DBForeignKey.ReferenceTableNameInvoker.Instance, CompareType.Equal, reference.FullName));
 }
Exemplo n.º 19
0
 public static Dictionary <DBColumn, int> WriteColumns(BinaryWriter bw, DBTable tble)
 {
     return(WriteColumns(bw, tble.Columns));
 }