public void Insert(REF_Client oREF_Client, DB_Handle oDB_Handle) { //** DL_Client oDL_Client = new DL_Client(); try { bool newDBHandle = false; if (oDB_Handle == null) { oDB_Handle = new DB_Handle(); oDB_Handle.OpenConnection(); oDB_Handle.BeginTransaction(); newDBHandle = true; } //** oDL_Client.Insert(oREF_Client, oDB_Handle); if (newDBHandle) { oDB_Handle.CommitTransaction(); oDB_Handle.CloseConnection(); } } catch (Exception ex) { oDB_Handle.RollbackTransaction(); oDB_Handle.CloseConnection(); throw ex; } }
public DataTable SelectOne(String _id, DB_Handle oDB_Handle) { DL_Client oDL_Client = new DL_Client(); DataTable oDataTable = new DataTable(); try { bool newDBHandle = false; if (oDB_Handle == null) { oDB_Handle = new DB_Handle(); oDB_Handle.OpenConnection(); oDB_Handle.BeginTransaction(); newDBHandle = true; } oDataTable = oDL_Client.SelectOne(_id, oDB_Handle); if (newDBHandle) { oDB_Handle.CommitTransaction(); oDB_Handle.CloseConnection(); } } catch (Exception ex) { oDB_Handle.RollbackTransaction(); oDB_Handle.CloseConnection(); throw ex; } return(oDataTable); }
public void DeleteOne(String _dlt_ap_id, DB_Handle oDB_Handle) { DL_Client oDL_Client = new DL_Client(); try { bool newDBHandle = false; if (oDB_Handle == null) { oDB_Handle = new DB_Handle(); oDB_Handle.OpenConnection(); oDB_Handle.BeginTransaction(); newDBHandle = true; } oDL_Client.DeleteOne(_dlt_ap_id, oDB_Handle); if (newDBHandle) { oDB_Handle.CommitTransaction(); oDB_Handle.CloseConnection(); } } catch (Exception ex) { oDB_Handle.RollbackTransaction(); oDB_Handle.CloseConnection(); throw ex; } }