コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #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);
        }
コード例 #4
0
 public void Delete(IDGBase vl)
 {
     Delete(vl, Adp);
 }
コード例 #5
0
 public void Update(IDGBase vl)
 {
     Update(vl, Adp);
 }
コード例 #6
0
 public Int64 Insert(IDGBase vl)
 {
     return(Insert(vl, Adp));
 }