Exemplo n.º 1
0
        private static void CompaniesListRequestLog()
        {
            var requestLogs = RequestLogDataHandler.GetRequestLog(RequestType.CompaniesList);

            if (requestLogs != null)
            {
                foreach (var rLog in requestLogs)
                {
                    Console.WriteLine(rLog.ID + ":" + rLog.ResponseData);
                }
            }
        }
Exemplo n.º 2
0
        private static void ConvertCompaniesListRequestLog()
        {
            var requestLogs = RequestLogDataHandler.GetRequestLog(RequestType.CompaniesList);

            if (requestLogs != null)
            {
                var requestLog = requestLogs[0];
                var jsonData   = JsonConvert.DeserializeObject <CompaniesJson>(requestLog.ResponseData);

                Console.WriteLine(jsonData.companies);

                if (jsonData.companies != null)
                {
                    foreach (var cmp in jsonData.companies)
                    {
                        StockCompanyDataHandler.AddStockCompany(cmp);
                    }
                }
            }

            Console.WriteLine("ConvertCompaniesListRequestLog completed.");
        }