Skip to content

Commit

Permalink
-- fixed issue with prepared statements and new mysql.data 8
Browse files Browse the repository at this point in the history
-- fixed issues with initial bibnumbers not being uploaded
-- changed logging from hh to HH
  • Loading branch information
petlof committed Jul 23, 2022
1 parent 216c7b0 commit 2b8a9b6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
6 changes: 3 additions & 3 deletions LiveResults.Client/FrmMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void m_Parser_OnResult(Result newResult)
foreach (EmmaMysqlClient client in m_Clients)
{
if (!client.IsRunnerAdded(newResult.ID))
client.AddRunner(new Runner(newResult.ID, newResult.RunnerName, newResult.RunnerClub, newResult.Class));
client.AddRunner(new Runner(newResult.ID, newResult.RunnerName, newResult.RunnerClub, newResult.Class,null,newResult.bib));
else
client.UpdateRunnerInfo(newResult.ID, newResult.RunnerName, newResult.RunnerClub, newResult.Class, null, newResult.bib);

Expand Down Expand Up @@ -81,7 +81,7 @@ void m_Parser_OnLogMessage(string msg)
{
listBox1.Invoke(new MethodInvoker(delegate
{
listBox1.Items.Insert(0, DateTime.Now.ToString("hh:mm:ss") + " " + msg);
listBox1.Items.Insert(0, DateTime.Now.ToString("HH:mm:ss") + " " + msg);
}));
}
}
Expand Down Expand Up @@ -128,7 +128,7 @@ void cli_OnLogMessage(string msg)
{
listBox1.Invoke(new MethodInvoker(delegate
{
listBox1.Items.Insert(0, DateTime.Now.ToString("hh:mm:ss") + " " + msg);
listBox1.Items.Insert(0, DateTime.Now.ToString("HH:mm:ss") + " " + msg);
}));
}
}
Expand Down
5 changes: 4 additions & 1 deletion LiveResults.Client/Parsers/OlaParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ private void Run()
IDbCommand cmdSplits = m_connection.CreateCommand();
IDbCommand cmdSplitTimes = m_connection.CreateCommand();
cmdSplits.CommandText = splitbaseCommand;



IDbDataParameter param = cmd.CreateParameter();
param.ParameterName = "date";
if (m_connection is MySql.Data.MySqlClient.MySqlConnection || m_connection is System.Data.H2.H2Connection)
Expand Down Expand Up @@ -220,7 +223,7 @@ private void Run()
if (!string.IsNullOrEmpty(splitsPaths))
splitsToRead = new List<object[]>();

cmd.Prepare();

reader = cmd.ExecuteReader();
while (reader.Read())
{
Expand Down
30 changes: 1 addition & 29 deletions LiveResults.Model/EmmaMysqlClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,35 +355,7 @@ public void Start()
}
}

/* private void LoadDataForPreviousStages(MySqlCommand cmd)
{
MySqlDataReader reader;
if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["multistage_day1"]))
{
int stageId = Convert.ToInt32(ConfigurationManager.AppSettings["multistage_day1"]);
cmd.CommandText = "select dbid, time, status from results where control = 1000 and tavid = " + stageId;
reader = cmd.ExecuteReader();
while (reader.Read())
{
var dbId = Convert.ToInt32(reader["dbId"]);
int time = Convert.ToInt32(reader["time"]);
int status = Convert.ToInt32(reader["status"]);
m_runnerPreviousDaysTotalTime.Add(dbId, new int[]
{
time, status
});
if (m_runners.ContainsKey(dbId))
{
m_runners[dbId].SetResultFromPreviousDays(time, status);
}
}
reader.Close();
}
}*/


public void UpdateRunnerInfo(int id, string name, string club, string Class, string sourceId, string bib)
{
if (m_runners.ContainsKey(id))
Expand Down

0 comments on commit 2b8a9b6

Please sign in to comment.