private IQuotesDalProcessTickerResult RunTickerETL(long tickerId) { IQuotesDalProcessTickerResult result = new QuotesDalMSSQLProcessTickerResult(); string spName = "[SP_Ticker_ETL]"; SqlConnection conn = OpenConnection("ConnectionStringTimeSeries"); SqlCommand cmd = new SqlCommand(); cmd.CommandText = schema + "." + spName; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = conn; var paramTickerId = new SqlParameter("@IN_Ticker_Id", SqlDbType.Int, 0, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Current, tickerId); cmd.Parameters.Add(paramTickerId); cmd.ExecuteNonQuery(); conn.Close(); result.Success = true; return(result); }
public IQuotesDalProcessTickerResult ProcessTicker(IQuotesDalProcessTickerParams procTickerParams) { IQuotesDalProcessTickerResult result = new QuotesDalMSSQLProcessTickerResult(); try { switch (procTickerParams.Type) { case "ETL": result = RunTickerETL(procTickerParams.TickerId); break; default: result.Errors.Add(new Interfaces.Error() { Code = Interfaces.EErrorCodes.TickerProcessingFail, Type = Interfaces.EErrorType.Error, Message = string.Format("Unknown processing type '{0}'", procTickerParams.Type) } ); result.Success = false; break; } } catch (Exception ex) { result.Errors.Add(new Interfaces.Error() { Code = Interfaces.EErrorCodes.TickerProcessingFail, Type = Interfaces.EErrorType.Error, Message = ex.Message } ); result.Success = false; } return(result); }