Exemplo n.º 1
0
        public void Delete(IDGBase vl, IDBExecutor exec)
        {
            SchemaTable t = Schema.EnsureSchema(vl.GetType());

            if (t != null)
            {
                SQDeleteQuery dlt = new SQDeleteQuery()
                {
                    DeleteTable = new SQAliasableObject(t.Table.Name),
                    Condition   = new SQCondition(t.Table.GetPrimaryKey().Name, SQRelationOperators.Equal, vl.ID.ToString())
                };
                dlt.Execute(exec);
            }
        }
Exemplo n.º 2
0
        public void Update(IDGBase vl, IDBExecutor exec)
        {
            SchemaTable t = Schema.EnsureSchema(vl.GetType());

            if (t != null)
            {
                SQUpdateQuery upd = new SQUpdateQuery()
                {
                    UpdateTable = new SQAliasableObject(t.Table.Name),
                    Condition   = new SQCondition(t.Table.GetPrimaryKey().Name, SQRelationOperators.Equal, vl.ID.ToString())
                };
                PopulateSetQuery(upd, vl, t);
                upd.Execute(exec);
            }
        }
Exemplo n.º 3
0
        public Int64 Insert(IDGBase vl, IDBExecutor exec)
        {
            SchemaTable t = Schema.EnsureSchema(vl.GetType());

            if (t != null)
            {
                SQInsertQuery ins = new SQInsertQuery()
                {
                    Table    = new SQAliasableObject(t.Table.Name),
                    ReturnID = true
                };
                PopulateSetQuery(ins, vl, t);
                return(ins.ExecuteReturnID <Int64>(exec));
            }

            return(-1);
        }
Exemplo n.º 4
0
 public void Delete(IDGBase vl)
 {
     Delete(vl, Adp);
 }
Exemplo n.º 5
0
 public void Update(IDGBase vl)
 {
     Update(vl, Adp);
 }
Exemplo n.º 6
0
 public Int64 Insert(IDGBase vl)
 {
     return(Insert(vl, Adp));
 }