Пример #1
0
        public static int LibScsMain(String spec, ref String Buff, ref String Cource)
        {
            switch (spec)
            {
            case "YS":
                JVData_Struct.JV_YS_SCHEDULE JvSche = new JVData_Struct.JV_YS_SCHEDULE();
                conv.JvConv JvConv = new conv.JvConv();

                String res = "";
                JvSche.SetDataB(ref Buff);
                if (JvConv.JvConvJyoCdToString(JvSche.id.JyoCD, ref res) == 0)
                {
                    return(0);                                                               //競馬場コードが不明のときはエラー
                }
                Cource = res;
                return(1);

            case "RA":
                JVData_Struct.JV_RA_RACE JvRace = new JVData_Struct.JV_RA_RACE();
                conv.JvConv JvConv1             = new conv.JvConv();
                JvRace.SetDataB(ref Buff);
                String resRA = "";
                if (JvConv1.JvConvJyoCdToString(JvRace.id.JyoCD, ref resRA) == 0)
                {
                    return(0);                                                                  //競馬場コードが不明のときはエラー
                }
                Cource = resRA;
                return(1);
            }
            return(1);
        }
Пример #2
0
        private int GetMasterDataYS()
        {
            int ret;
            int LibRet = 0;

            ret = JV_FORM.JvForm_JvInit();
            JVData_Struct.JV_YS_SCHEDULE jVData = new JVData_Struct.JV_YS_SCHEDULE();

            if (ret != 0)
            {
                return(ret);
            }

            int    rdCount       = 0;
            int    dlCount       = 0;
            String lastTimeCount = "";

            ret = JV_FORM.JvForm_JvOpen("YSCH", "20180101000000", 1, ref rdCount, ref dlCount, ref lastTimeCount);

            /* JvOpenのエラーハンドリング */
            if (ret != 0)
            {
                if (ret == -202)
                {
                    JV_FORM.JvForm_JvClose();
                    ret = JV_FORM.JvForm_JvOpen("YSCH", "20180101000000", 1, ref rdCount, ref dlCount, ref lastTimeCount);
                    if (ret != 0)
                    {
                        JV_FORM.JvForm_JvClose();
                        return(0); /* エラー */
                    }
                }
                else
                {
                    JV_FORM.JvForm_JvClose();
                    return(0); /* エラー */
                }
            }

            String buff  = "";
            int    size  = 20000;
            String fname = "";


            progressBar1.Value = 0;
            ret = 1;
            db.DeleteCsv("YS");

            String tmp = "";

            while (ret >= 1)
            {
                ret = JV_FORM.JvForm_JvRead(ref buff, out size, out fname);

                if (buff == "")
                {
                    continue;
                }

                if (ret > 0)
                {
                    progressBar1.Maximum = ret;
                    progressBar1.Value++;

                    switch (buff.Substring(0, 2))
                    {
                    case "YS":
                        jVData.SetDataB(ref buff);
                        tmp += jVData.id.Year + jVData.id.MonthDay + ",";
                        tmp += jVData.id.Kaiji + ",";
                        tmp += jVData.id.JyoCD + ",";
                        tmp += jVData.id.Kaiji + ",";
                        tmp += jVData.crlf;
                        db   = new dbConnect(jVData.id.Year + jVData.id.MonthDay, "YS", ref tmp, ref ret);
                        break;
                    }
                }

                if (ret == 0)
                {
                    break;
                }
            }
            JV_FORM.JvForm_JvClose();
            return(1);
        }
Пример #3
0
        private List <string> GetPlaceInfoX(DateTime datetimeTarg)
        {
            List <string> stringList = new List <string>();

            try
            {
                int size  = 110000;
                int count = 256;
                JVData_Struct.JV_YS_SCHEDULE jvYsSchedule = new JVData_Struct.JV_YS_SCHEDULE();
                this.tmrDownload.Enabled = false;
                this.prgJVRead.Value     = 0;
                string   dataspec      = "YSCH";
                TimeSpan timeSpan      = new TimeSpan(1, 0, 0, 0);
                string   str           = (datetimeTarg - timeSpan).ToString("yyyyMMdd");
                int      option        = DateTime.Now > datetimeTarg.AddYears(1) ? 4 : 1;
                int      readcount     = 0;
                int      downloadcount = 0;
                int      num1          = this.AxJVLink1.JVOpen(dataspec, str + "000000", option, ref readcount, ref downloadcount, out string _);
                if (num1 != 0)
                {
                    int num2 = (int)MessageBox.Show("JVOpen エラー:" + (object)num1);
                }
                else
                {
                    this.prgJVRead.Maximum = readcount;
                    if (readcount > 0)
                    {
                        bool flag   = false;
                        bool isFind = false;
                        do
                        {
                            System.Windows.Forms.Application.DoEvents();
                            string buff     = new string(char.MinValue, size);
                            string filename = new string(char.MinValue, count);
                            switch (this.AxJVLink1.JVRead(out buff, out size, out filename))
                            {
                            case -503:
                                int num3 = (int)MessageBox.Show(filename + "が存在しません。");
                                flag = true;
                                goto case -3;

                            case -203:
                                int num4 = (int)MessageBox.Show("JVOpen が行われていません。");
                                flag = true;
                                goto case -3;

                            case -201:
                                int num5 = (int)MessageBox.Show("JVInit が行われていません。");
                                flag = true;
                                goto case -3;

                            case -3:
                                continue;

                            case -1:
                                ++this.prgJVRead.Value;
                                goto case -3;

                            case 0:
                                this.prgJVRead.Value = this.prgJVRead.Maximum;
                                flag = true;
                                goto case -3;

                            default:
                                if (buff.Substring(0, 2) == "YS")
                                {
                                    jvYsSchedule.SetDataB(ref buff);
                                    DateTime dateTime = DateTime.Parse((jvYsSchedule.id.Year + jvYsSchedule.id.MonthDay).Insert(4, "/").Insert(7, "/"));
                                    int      num6     = dateTime > datetimeTarg ? 1 : 0;
                                    string   codeName = this.objCodeConv.GetCodeName("2001", jvYsSchedule.id.JyoCD, (short)1);
                                    if (dateTime.Date == datetimeTarg.Date)
                                    {
                                        isFind = false;
                                        foreach (string ele in stringList)
                                        {
                                            if (ele == codeName)
                                            {
                                                isFind = true;
                                            }
                                        }
                                        if (!isFind)
                                        {
                                            stringList.Add(codeName);
                                            goto case -3;
                                        }
                                    }
                                    else
                                    {
                                        goto case -3;
                                    }
                                }
                                goto case -3;
                            }
                        }while (!flag);
                    }
                }
            }
            catch (Exception ex)
            {
                return((List <string>)null);
            }
            int num7 = this.AxJVLink1.JVClose();

            if (num7 != 0)
            {
                int num8 = (int)MessageBox.Show("JVClose エラー:" + (object)num7);
            }
            this.prgJVRead.Value = this.prgJVRead.Maximum;
            return(stringList);
        }
Пример #4
0
        private bool isRunRace(DateTime datetimeTarg)
        {
            bool flag1 = false;

            try
            {
                int size  = 110000;
                int count = 256;
                JVData_Struct.JV_YS_SCHEDULE jvYsSchedule = new JVData_Struct.JV_YS_SCHEDULE();
                this.tmrDownload.Enabled = false;
                this.prgJVRead.Value     = 0;
                string   dataspec      = "YSCH";
                TimeSpan timeSpan      = new TimeSpan(7, 0, 0, 0);
                string   str           = (datetimeTarg - timeSpan).ToString("yyyyMMdd");
                int      option        = DateTime.Now > datetimeTarg.AddYears(1) ? 4 : 1;
                int      readcount     = 0;
                int      downloadcount = 0;
                int      num1          = this.AxJVLink1.JVOpen(dataspec, str + "000000", option, ref readcount, ref downloadcount, out string _);
                if (num1 != 0)
                {
                    int num2 = (int)MessageBox.Show("JVOpen エラー:" + (object)num1);
                }
                else
                {
                    this.prgJVRead.Maximum = readcount;
                    if (readcount > 0)
                    {
                        bool flag2 = false;
                        do
                        {
                            System.Windows.Forms.Application.DoEvents();
                            string buff     = new string(char.MinValue, size);
                            string filename = new string(char.MinValue, count);
                            switch (this.AxJVLink1.JVRead(out buff, out size, out filename))
                            {
                            case -503:
                                int num3 = (int)MessageBox.Show(filename + "が存在しません。");
                                flag2 = true;
                                goto case -3;

                            case -203:
                                int num4 = (int)MessageBox.Show("JVOpen が行われていません。");
                                flag2 = true;
                                goto case -3;

                            case -201:
                                int num5 = (int)MessageBox.Show("JVInit が行われていません。");
                                flag2 = true;
                                goto case -3;

                            case -3:
                                continue;

                            case -1:
                                ++this.prgJVRead.Value;
                                goto case -3;

                            case 0:
                                this.prgJVRead.Value = this.prgJVRead.Maximum;
                                flag2 = true;
                                goto case -3;

                            default:
                                jvYsSchedule.SetDataB(ref buff);
                                if (jvYsSchedule.id.Year + jvYsSchedule.id.MonthDay == datetimeTarg.ToString("yyyyMMdd"))
                                {
                                    flag1 = true;
                                    flag2 = true;
                                    goto case -3;
                                }
                                else
                                {
                                    goto case -3;
                                }
                            }
                        }while (!flag2);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            int num6 = this.AxJVLink1.JVClose();

            if (num6 != 0)
            {
                int num7 = (int)MessageBox.Show("JVClose エラー:" + (object)num6);
            }
            if (flag1)
            {
                return(true);
            }
            //int num8 = (int)MessageBox.Show("選択した日付の開催はありません。");
            return(false);
        }