public virtual ListStocksResponse ListStocks(ListStocksRequest request) { var response = new ListStocksResponse(); try { // Raise Initialization Event var initialization = ListStocksInitialization; if (initialization != null) { initialization(request, response); } // Raise Execute Event var execute = ListStocksExecute; if (execute != null) { response = execute(request); } // Raise Complete Event var complete = ListStocksComplete; if (complete != null) { complete(request, response); } } catch (Exception exception) { // Raise Error Event var error = ListStocksError; if (error != null) { error(request, response, exception); } } return(response); }
public override ListStocksResponse OnListStocksExecute(ListStocksRequest request) { var stockFactory = new StockFactory(); var response = new ListStocksResponse(); try { response.ListStocks = stockFactory.ListStocks(request.ItemCode); } catch (Exception ex) { response.Exception = ex; response.Message = ex.Message; } return(response); }