コード例 #1
0
ファイル: DatabaseHelper.cs プロジェクト: SimCitee/ProjetBD2
        public void Delete(ModelBase model)
        {
            try {
                Connection.Open();
                _transaction = Connection.BeginTransaction();

                LogTransaction(LogActions.Started);
                model.Delete(this);
                LogTransaction(LogActions.Confirmed, String.Empty);
            }
            catch (OracleException e) {
                _transaction.Rollback();
                LogTransaction(LogActions.Cancelled, String.Empty);
                throw e;
            }
            finally {
                if (Connection != null)
                {
                    Connection.Close();
                }

                _transaction = null;
            }
        }