Beispiel #1
0
        private static bool TestDownloadStockDataFromBSE(string bseDownloadUrl, string destinationFilePath)
        {
            var input = new DownloadStockDataFromBSEInput();
            input.BSEDownloadUrl = bseDownloadUrl;
            input.DestinationFilePath = destinationFilePath;

            var output = new DownloadStockDataFromBSE().Execute(input);

            return output.IsSuccessfullyDownloaded;
        }
Beispiel #2
0
        private static bool TestDownloadStockDataFromBSE(string bseDownloadUrl, string destinationFilePath)
        {
            var input = new DownloadStockDataFromBSEInput();

            input.BSEDownloadUrl      = bseDownloadUrl;
            input.DestinationFilePath = destinationFilePath;

            var output = new DownloadStockDataFromBSE().Execute(input);

            return(output.IsSuccessfullyDownloaded);
        }
        public DownloadStockDataFromBSEOutput Execute(DownloadStockDataFromBSEInput input)
        {
            // Assign and Validate Input
            _input = input;
            _input.ValidateInput();

            // Initialize Output
            _output = new DownloadStockDataFromBSEOutput();

            // Download the file
            using (var webClient = new WebClient())
            {
                webClient.DownloadFile(_input.BSEDownloadUrl, _input.DestinationFilePath);
                _output.IsSuccessfullyDownloaded = true;
            }

            return _output;
        }
        public DownloadStockDataFromBSEOutput Execute(DownloadStockDataFromBSEInput input)
        {
            // Assign and Validate Input
            _input = input;
            _input.ValidateInput();


            // Initialize Output
            _output = new DownloadStockDataFromBSEOutput();

            // Download the file
            using (var webClient = new WebClient())
            {
                webClient.DownloadFile(_input.BSEDownloadUrl, _input.DestinationFilePath);
                _output.IsSuccessfullyDownloaded = true;
            }

            return(_output);
        }