Beispiel #1
0
        bool GetRTDataDetailData1(ClassCSV cCSV, string strDateTarg,
                                  string placeTarg, string racenumTarg)
        {
            string codeJyo;
            string retbuff;

            codeJyo = cCommon.JyogyakuCord(placeTarg);
            if (codeJyo == "")
            {
                return(false);
            }

            //速報オッズ(馬単)の呼び出し
            retbuff = GeJVRTRead(strDateTarg, codeJyo, racenumTarg, "0B34", 4100);
            if (retbuff == null)
            {
                return(false);
            }
            listUmatanOdds = cCommon.setDataO4(retbuff, strDateTarg,
                                               placeTarg, racenumTarg);

            //速報オッズ(単複枠)の呼び出し
            retbuff = GeJVRTRead(strDateTarg, codeJyo, racenumTarg, "0B31", 1000);
            if (retbuff == null)
            {
                return(false);
            }
            listUmatanOddsO1 = cCommon.setDataO1(retbuff, strDateTarg,
                                                 placeTarg, racenumTarg);


            //3連単オッズの呼び出し
            retbuff = GeJVRTRead(strDateTarg, codeJyo, racenumTarg, "0B36", 110000);
            if (retbuff == null)
            {
                return(false);
            }
            listOddsSanrentan = cCommon.setDataO6(retbuff, strDateTarg,
                                                  placeTarg, racenumTarg);

            //速報票数(全賭式)の呼び出し
            retbuff = GeJVRTRead(strDateTarg, codeJyo, racenumTarg, "0B20", 30000);
            if (retbuff != null)
            {
                listUmatanOddsH1 = cCommon.setDataH1(retbuff, strDateTarg,
                                                     placeTarg, racenumTarg);
            }

            return(true);
        }
        int GetStockDataDetailData1(string strDateTarg, string placeTarg, string racenumTarg)
        {
            DateTime datetimeTarg;
            DateTime dateTime;

            datetimeTarg = DateTime.Parse(strDateTarg.Insert(4, "/").Insert(7, "/"));

            TimeSpan timeSpan = new TimeSpan(1, 0, 0, 0);
            string   strDate  =
                (datetimeTarg - timeSpan).ToString("yyyyMMdd");
            bool   isFind = false;
            string retbuff;
            long   cntLoop = 0;

            size  = 840000;
            count = 256;
            int option = DateTime.Now >
                         datetimeTarg.AddYears(1) ? 4 : 1;

            _form1.prgJVRead.Value = 0;
            if (!cCommon.isJVOpen("RACE", strDate, option))
            {
                return(-1);
            }
            do
            {
                retbuff = cCommon.loopJVRead(size, count, true);
                if (retbuff == "" || retbuff == "END")
                {
                    break;
                }
                Console.WriteLine(retbuff.Substring(11, 8).Insert(4, "/").Insert(7, "/"));
                dateTime = DateTime.Parse(retbuff.Substring(11, 8).Insert(4, "/").Insert(7, "/"));
                if (isFind && dateTime > datetimeTarg)
                {
                    break;
                }
                //票数1
                if (retbuff.Substring(0, 2) == "H1")
                {
                    //setDataH1(retbuff, strDateTarg, placeTarg, racenumTarg);
                    if (listUmatanOddsH1 == null)
                    {
                        listUmatanOddsH1 = cCommon.setDataH1(retbuff, strDateTarg,
                                                             placeTarg, racenumTarg);
                    }
                }
                //オッズ(単複枠)
                if (retbuff.Substring(0, 2) == "O1")
                {
                    //setDataO1(retbuff, strDateTarg, placeTarg, racenumTarg);
                    if (listUmatanOddsO1 == null)
                    {
                        listUmatanOddsO1 = cCommon.setDataO1(retbuff, strDateTarg,
                                                             placeTarg, racenumTarg);
                    }
                }
                //オッズ(馬単)
                if (retbuff.Substring(0, 2) == "O4")
                {
                    //setDataO4(retbuff, strDateTarg, placeTarg, racenumTarg);
                    if (listUmatanOdds == null)
                    {
                        listUmatanOdds = cCommon.setDataO4(retbuff, strDateTarg,
                                                           placeTarg, racenumTarg);
                    }
                }
                //3連単オッズ
                if (retbuff.Substring(0, 2) == "O6")
                {
                    //if (setDataO6(retbuff, strDateTarg, placeTarg, racenumTarg))
                    //    isFind = true;
                    if (listOddsSanrentan == null)
                    {
                        listOddsSanrentan = cCommon.setDataO6(retbuff, strDateTarg,
                                                              placeTarg, racenumTarg);
                    }
                    if (listOddsSanrentan != null)
                    {
                        isFind = true;
                    }
                }
                cntLoop++;
            }while (cntLoop <= 100000);
            _form1.prgJVRead.Maximum++;
            _form1.prgJVRead.Value =
                _form1.prgJVRead.Maximum;
            _form1.prgJVRead.Maximum--;

            int retJVClose = _form1.axJVLink1.JVClose();

            if (retJVClose != 0)
            {
                cLog.writeLog("[GetStockDataDetailData1]JVClose エラー:" +
                              retJVClose);
            }

            if (listUmatanOddsH1.Count == 0 ||
                listUmatanOddsO1.Count == 0 ||
                listUmatanOdds.Count == 0 ||
                listOddsSanrentan.Count == 0)
            {
                return(-1);
            }

            return(1);
        }