public bool Remove(ParameterSystemObject parameterSystem) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "ParameterSystem_DELETE", CreateParameter("@parID", SqlDbType.UniqueIdentifier, parameterSystem.ParID, ParameterDirection.Input) ); return(true); } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void Save(ParameterSystemObject parameterSystem) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "ParameterSystem_SAVE", CreateParameter("@parID", SqlDbType.UniqueIdentifier, parameterSystem.ParID, ParameterDirection.InputOutput), CreateParameter("@KeyName", SqlDbType.NVarChar, parameterSystem.KeyName), CreateParameter("@Value", SqlDbType.NVarChar, parameterSystem.Value) ); parameterSystem.ParID = (Guid)cmd.Parameters["@parID"].Value; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void Remove(ParameterSystemObject parameter) { try { CheckTransaction(); new ParameterSystemDataService(Transaction).Remove(parameter); if (IsOwner) { Transaction.Commit(); } } catch (Exception exception1) { if (IsOwner) { Transaction.Rollback(); } Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) { Connection.Close(); } } }