Example #1
0
        public void update(string pathTarg)
        {
            cLog.writeLog("update");
            cOperateForm.disableButton();

            DateTime datetimeTarg;
            //string pathTarg;
            string pathFileR;

            //pathTarg = _form1.textBox1.Text;

            // 出馬表の読み込み
            pathFileR = GetRaceCardFile(pathTarg);
            if (pathFileR == "")
            {
                cOperateForm.enableButton();
                return;
            }

            // 出馬表の読み込み
            //listRcsv = ReadCSV(pathFileR);

            var encoding = Encoding.GetEncoding("shift_jis");

            //cCSV.dataCsvAll = File.ReadAllText(pathFileR, encoding);
            cCSV.linedataCsvAll = File.ReadAllLines(pathFileR, encoding);
            cCSV.createCSVarrdata();



            string tmp;

            tmp          = cCSV.getData(2, 1);
            datetimeTarg = DateTime.Parse(tmp);

            // 追加項目を記入
            writeHeadData(cCSV);

            // 速報開催情報(一括)の呼び出し
            int retval = 0;

            retval = checkJVRTOpen(datetimeTarg);
            if (retval < -1)
            {
                return;
            }

            if (retval == -1)
            {
                cRaceCardStock.GetStockDataDetailData(cCSV, datetimeTarg);
            }
            else
            {
                cRaceCardRT.GetRTDataDetailData(cCSV, datetimeTarg);
            }

            deleteZanteiData(cCSV);

            // ファイル出力
            cCSV.createCSVdataAll();
            File.WriteAllText(pathFileR, cCSV.dataCsvAll, encoding);

            _form1.rtbData.Text = datetimeTarg.ToShortDateString() +
                                  " 出馬表更新完了しました。";

            //_axJVLink1.JVClose();
            _form1.axJVLink1.JVClose();
            System.Media.SystemSounds.Asterisk.Play();
            cOperateForm.enableButton();
        }