Esempio n. 1
0
        /// <summary>
        /// Метод загрузки данных
        /// </summary>
        /// <param name="IPair">Объект интернет</param>
        public void LoadData(Internet IPair)
        {
            tEurusd = Task.Run(() =>
            {
                string pathFile1 = Application.StartupPath + "\\" + "eurusd" + ".txt"; // Путь к файлу c котировками eurusd
                IPair.FirstConnect("eurusd", pathFile1); // первое подключении
            }); // поток подключения eurusd

            string pathFile = Application.StartupPath + "\\" + "eurusd" + ".txt";
            string patch = "Data Source = (LocalDB)\\MSSQLLocalDB; AttachDbFilename='|DataDirectory|\\Forex.mdf'; Integrated Security = True; Connect Timeout = 30";// данные конфигурации
            BdReqest reqestBdEURUSD = new BdReqest(patch); // Создание объекта БД
            string bdValue = "eurusd";
            string response = IPair.FirstConnectBD(bdValue, pathFile);
            List<int> BListTBuf = new List<int>();
            List<double> BListBBuf = new List<double>();
            List<double> BListSBuf = new List<double>();
            Parser BdParser = new Parser(response);
            // Присвоили данные к листам
            BdParser.BDREqest(ref BListTBuf, ref BListBBuf, ref BListSBuf);
            // Важный запрос добавления осталось это проверить
            reqestBdEURUSD.CommandInsert (bdValue, BListTBuf, BListBBuf, BListSBuf);

            tUsdjpy = Task.Run(() =>
            {
                string pathFile2 = Application.StartupPath + "\\" + "usdjpy" + ".txt"; // Путь к файлу c котировками usdjpy
                IPair.FirstConnect("usdjpy", pathFile2); // первое подключении
            }); // поток подключения usdjpy
        }