public questStatus Delete(TablesetId tablesetId) { // Initialize questStatus status = null; // Delete tableset status = _dbTablesetsMgr.Delete(tablesetId); if (!questStatusDef.IsSuccess(status)) { return(status); } return(new questStatus(Severity.Success)); }
public questStatus Delete(TablesetId tablesetId) { // Initialize questStatus status = null; DbMgrTransaction trans = null; // BEGIN TRANSACTION status = BeginTransaction("DeleteTableset_" + Guid.NewGuid().ToString(), out trans); if (!questStatusDef.IsSuccess(status)) { return(status); } try { // Delete tableset filters FiltersMgr filtersMgr = new FiltersMgr(this.UserSession); status = filtersMgr.Delete(trans, tablesetId); if (!questStatusDef.IsSuccess(status)) { RollbackTransaction(trans); return(status); } // Delete Tableset DbTablesetsMgr dbTablesetsMgr = new DbTablesetsMgr(this.UserSession); status = dbTablesetsMgr.Delete(tablesetId); if (!questStatusDef.IsSuccess(status)) { RollbackTransaction(trans); return(status); } // COMMIT TRANSACTION status = CommitTransaction(trans); if (!questStatusDef.IsSuccess(status)) { return(status); } } catch (System.Exception ex) { if (trans != null) { RollbackTransaction(trans); } return(new questStatus(Severity.Fatal, String.Format("EXCEPTION: {0}.{1}: {2}", this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.InnerException != null ? ex.InnerException.Message : ex.Message))); } return(new questStatus(Severity.Success)); }