Example #1
0
        private static void InsertAutoIncrementColumnTest()
        {
            var db = CreateDatabase();
            var x = db.ExecuteCommand("Delete from IdentityTable");

            OutputTestResult("Query: Delete IdentityTable", true);

            Int32 pk = 0;
            for (int i = 0; i < 3; i++)
            {
                var sp = new identitytableInsert();
                sp.NVarCharColumn = "NVarChar";
                var x1 = sp.ExecuteNonQuery();
                pk = sp.IntColumn;
                OutputTestResult("IdentityTable.Insert", x1 == 1);
            }
            var t = new identitytable();
            var r = t.SelectByPrimaryKey(pk);
            r.NVarCharColumn = "New NVarChar2";
            var x2 = t.Update(r);
            OutputTestResult("IdentityTable.Update", x2 == 1);

            var x3 = t.Delete(r);
            OutputTestResult("IdentityTable.Delete", x3 == 1);
        }
Example #2
0
        public identitytableInsert CreateInsertStoredProcedure(Record record)
        {
            var sp = new identitytableInsert();

            if (record == null)
            {
                return(sp);
            }
            sp.IntColumn       = record.IntColumn;
            sp.TimestampColumn = record.TimestampColumn;
            sp.NVarCharColumn  = record.NVarCharColumn;
            return(sp);
        }
Example #3
0
        public identitytableInsert CreateInsertStoredProcedure(Record record)
        {
            var sp = new identitytableInsert();

            ((IDatabaseContext)sp).TransactionKey = this.TransactionKey;
            if (record == null)
            {
                return(sp);
            }
            sp.IntColumn       = record.IntColumn;
            sp.TimestampColumn = record.TimestampColumn;
            sp.NVarCharColumn  = record.NVarCharColumn;
            return(sp);
        }