public virtual DataSet GetDataSetByID(int iObjectID) { DbCommand storedProcedure = SqlDatabaseHelper.GetStoredProcedure(this.GenerateSelectByPrimaryKeyStoredProcedureName()); SqlDatabaseHelper.AddInParameter(storedProcedure, SqlDatabaseHelper.GetPrimaryKeyColumn(this.TableName), SqlDbType.Int, (object)iObjectID); return(SqlDatabaseHelper.RunStoredProcedure(storedProcedure)); }
public virtual void DeleteObject(int iObjectID) { DbCommand storedProcedure = SqlDatabaseHelper.GetStoredProcedure(this.GenerateDeleteStoredProcedureName()); SqlDatabaseHelper.AddInParameter(storedProcedure, SqlDatabaseHelper.GetPrimaryKeyColumn(this.TableName), SqlDbType.Int, (object)iObjectID); SqlDatabaseHelper.RunStoredProcedure(storedProcedure); }
public virtual object GetDeletedObjectByID(int iObjectID) { DbCommand storedProcedure = SqlDatabaseHelper.GetStoredProcedure(this.GenerateSelectDeletedByPrimayKeyStoredProcedureName()); SqlDatabaseHelper.AddInParameter(storedProcedure, SqlDatabaseHelper.GetPrimaryKeyColumn(this.TableName), SqlDbType.Int, (object)iObjectID); DataSet dataSet = SqlDatabaseHelper.RunStoredProcedure(storedProcedure); if (dataSet.Tables.Count <= 0) { return((object)null); } return(SqlDatabaseHelper.GetSingleObject(dataSet.Tables[0], this.ObjectType)); }
public virtual void DeleteObject(int iObjectID, DbTransaction transaction) { try { DbCommand storedProcedure = SqlDatabaseHelper.GetStoredProcedure(this.GenerateDeleteStoredProcedureName()); SqlDatabaseHelper.AddInParameter(storedProcedure, SqlDatabaseHelper.GetPrimaryKeyColumn(this.TableName), SqlDbType.Int, (object)iObjectID); storedProcedure.Transaction = transaction; SqlDatabaseHelper.RunStoredProcedure(storedProcedure); SqlDatabaseHelper.CommitTransaction(transaction); } catch (Exception ex) { SqlDatabaseHelper.RollbackTransaction(transaction); } }