public bool getDbDataPlace(string strDateTarg, string strPlace) { using (SQLiteConnection conn = new SQLiteConnection("Data Source=" + filenameDB)) { conn.Open(); string codeJyo = cCommon.JyogyakuCord( _form1.listBox1.SelectedItem.ToString().Substring(0, 2)); SQLiteCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT " + "*" + " FROM " + nameTableMain + " WHERE " + nameColumnMain1 + " = " + strDateTarg + " AND " + nameColumnMain2 + " = " + "'" + strPlace + "'"; using (SQLiteDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { _form1.listBox2.Items.Add(reader[nameColumnMain3].ToString()); } } conn.Close(); } if (_form1.listBox2.Items.Count > 0) { return(true); } else { return(false); } }
private void btnGetJVData_Click(object sender, EventArgs e) { //var sw = new System.Diagnostics.Stopwatch(); //sw.Start(); cLog.writeLog("btnGetJVData_Click"); DateTime datetimeTarg = dateTimePicker1.Value; string strDateTarg = datetimeTarg.ToString("yyyyMMdd"); string strPlace; string strRace; if (this.textBox1.Text == "") { System.Media.SystemSounds.Asterisk.Play(); MessageBox.Show("出力ファイルを保存するフォルダを選択してください。"); cOperateForm.enableButton(); return; } try { strPlace = listBox1.SelectedItem.ToString(); } catch { System.Media.SystemSounds.Asterisk.Play(); MessageBox.Show("会場を選択してください。"); cOperateForm.enableButton(); return; } try { strRace = listBox2.SelectedItem.ToString(); } catch { System.Media.SystemSounds.Asterisk.Play(); MessageBox.Show("レースを選択してください。"); cOperateForm.enableButton(); return; } UmatanOdds cUmatanOdds = new UmatanOdds(cCommon, cOperateForm, this); cUmatanOdds.getUmatanOdds(strDateTarg, strPlace, strRace); // 保持用 string codeJyo = cCommon.JyogyakuCord(strPlace.Substring(0, 2)); clsDbInfo cDbInfo = new clsDbInfo(); cDbInfo.strdate = strDateTarg; cDbInfo.nameJyo = strPlace; cDbInfo.racenum = strRace; cDbInfo.raceId = strDateTarg + codeJyo + strRace; cDatabase.putHistory(cDbInfo); //sw.Stop(); //TimeSpan ts = sw.Elapsed; //rtbData.Text = $"{ts}"; }
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); }