Пример #1
0
        /// <summary>
        /// Execute the insert and return the inserted identity value
        /// </summary>
        /// <param name="adp"></param>
        /// <returns></returns>
        public object ExecuteReturnID(IDBExecutor adp)
        {
            bool prevValue = ReturnID;

            ReturnID = true;

            SQSelectResult res = null;

            try
            {
                res = adp.Insert(this);

                if (res.Reader.Read())
                {
                    return(res.Reader.GetValue(0));
                }
            }
            finally
            {
                ReturnID = prevValue;
                if (res != null)
                {
                    res.Close();
                }
            }

            return(null);
        }
Пример #2
0
 public void Execute(IDBExecutor dbe)
 {
     dbe.Insert(this);
 }
Пример #3
0
 /// <summary>
 /// Execute the insert
 /// </summary>
 /// <param name="adp"></param>
 public void Execute(IDBExecutor adp)
 {
     adp.Insert(this).Close();
 }