public void Create(SSEListenerData listener) { _Log.Trace("Method Start"); _Log.Debug(LogHelper.Get("Input Params:=", new {Listener = listener })); _Log.Debug("PID : " + PID); try { _DBConnection.Open(); _DBCommand = new MySqlCommand("udsp_Url_Create", _DBConnection); _DBCommand.CommandType = CommandType.StoredProcedure; _DBCommand.Parameters.AddWithValue("var_OrgId" , listener.OrgId); _DBCommand.Parameters.AddWithValue("var_ApiKey" , listener.ApiKey); _DBCommand.Parameters.AddWithValue("var_Url" , listener.Url); _DBCommand.Parameters.AddWithValue("var_ShortCode" , listener.ShortCode); _DBCommand.Parameters.AddWithValue("var_PID", PID); _DBCommand.ExecuteNonQuery(); } catch (MySqlException exception) { _Log.Error(exception.Message, exception); throw exception; } catch (Exception exception) { _Log.Error(exception.Message, exception); throw exception; } finally { if (_DBConnection.State == ConnectionState.Open) { _DBConnection.Close(); } _Log.Trace("Method End"); } }
public void Delete(SSEListenerData listener) { _Log.Trace("Method Start"); try { _DBConnection.Open(); _DBCommand = new MySqlCommand("udsp_Url_Delete", _DBConnection); _DBCommand.CommandType = CommandType.StoredProcedure; _DBCommand.Parameters.AddWithValue("var_UrlBaseId", listener.Id); _DBCommand.ExecuteNonQuery(); } catch (MySqlException exception) { _Log.Error(exception.Message, exception); throw exception; } catch (Exception exception) { _Log.Error(exception.Message, exception); throw exception; } finally { if (_DBConnection.State == ConnectionState.Open) { _DBConnection.Close(); } _Log.Trace("Method End"); } }