public static bool DeleteByModule(int moduleId) { DBMediaFile.DeleteByModule(moduleId); StringBuilder sqlCommand = new StringBuilder(); sqlCommand.Append("DELETE FROM mp_MediaTrack "); sqlCommand.Append("WHERE "); sqlCommand.Append("PlayerID IN (SELECT PlayerID FROM mp_MediaPlayer WHERE ModuleID = @ModuleID) "); sqlCommand.Append(";"); FbParameter[] arParams = new FbParameter[1]; arParams[0] = new FbParameter("@ModuleID", FbDbType.Integer); arParams[0].Direction = ParameterDirection.Input; arParams[0].Value = moduleId; int rowsAffected = FBSqlHelper.ExecuteNonQuery( ConnectionString.GetWriteConnectionString(), sqlCommand.ToString(), arParams); return(rowsAffected > -1); }
public static bool DeleteByModule(int moduleId) { DBMediaFile.DeleteByModule(moduleId); StringBuilder sqlCommand = new StringBuilder(); sqlCommand.Append("DELETE FROM mp_mediatrack "); sqlCommand.Append("WHERE "); sqlCommand.Append("playerid IN (SELECT playerid FROM mp_mediaplayer WHERE moduleid = :moduleid) "); sqlCommand.Append(";"); NpgsqlParameter[] arParams = new NpgsqlParameter[1]; arParams[0] = new NpgsqlParameter("moduleid", NpgsqlTypes.NpgsqlDbType.Integer); arParams[0].Direction = ParameterDirection.Input; arParams[0].Value = moduleId; int rowsAffected = NpgsqlHelper.ExecuteNonQuery( ConnectionString.GetWriteConnectionString(), CommandType.Text, sqlCommand.ToString(), arParams); return(rowsAffected > -1); }