public void CommitTransaction() { if (this.Transaction != null) { LibraryMgr.CommitTransaction(this.Transaction); } }
public void RollbackTransaction() { if (this.Transaction != null) { LibraryMgr.RollbackTransaction(this.Transaction); } }
protected void initConnection() { if (this.Connection == null) { this.Connection = LibraryMgr.GetConnection(this.connectionStrType); } }
public void BeginTransaction() { if (this.Connection != null) { this.Transaction = LibraryMgr.BeginTransaction(this.Connection); lMgr.Transaction = this.Transaction; } }
protected void UpdateData(IDataAdapter adapter, DataSet dataSet) { lMgr.Connection = LibraryMgr.GetConnection(this.connectionStrType); lMgr.SetAdapterConnection(adapter, this.connectionStrType); try { adapter.Update(dataSet); } catch (Exception exception) { WebUtils.HandleException(exception); } }
protected void ExecuteCommand(System.Data.IDbCommand command) { lMgr.Connection = LibraryMgr.GetConnection(this.connectionStrType); lMgr.SetCommandConnection(command); try { if (command.Connection.State == ConnectionState.Closed) { command.Connection.Open(); } command.ExecuteNonQuery(); command.Connection.Close(); } catch (Exception exception) { command.Connection.Close(); WebUtils.HandleException(exception); } }
protected SqlDataReader ExecuteCommandReader(System.Data.IDbCommand command) { lMgr.Connection = LibraryMgr.GetConnection(this.connectionStrType); lMgr.SetCommandConnection(command); try { if (command.Connection.State == ConnectionState.Closed) { command.Connection.Open(); } return((SqlDataReader)command.ExecuteReader(CommandBehavior.CloseConnection)); } catch (Exception exception) { command.Connection.Close(); WebUtils.HandleException(exception); return(null); } }
protected DataSet FillData(IDataAdapter adapter, DataSet dataSet, string condition) { string Interncondition; if ((condition == "") || (condition == null)) { Interncondition = ""; } else { Interncondition = " where " + condition; } switch (connectionStrType) { case GVC.ConnectionSQL_AppE: ((System.Data.SqlClient.SqlDataAdapter)adapter).SelectCommand.CommandText += Interncondition; break; case GVC.ConnectionAccess_AppE: ((System.Data.OleDb.OleDbDataAdapter)adapter).SelectCommand.CommandText += Interncondition; break; default: ((System.Data.SqlClient.SqlDataAdapter)adapter).SelectCommand.CommandText += Interncondition; break; } lMgr.Connection = LibraryMgr.GetConnection(this.connectionStrType); lMgr.SetAdapterConnection(adapter, this.connectionStrType); try { adapter.Fill(dataSet); } catch (Exception exception) { WebUtils.HandleException(exception); } return(dataSet); }