You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using demo.ClassHelper.MsgBox;
using System.Windows.Forms;
namespace demo
{
class UpdateSql
{
public static void UpdateCheckState()
{
int listCount;
string yf_id = null;
while (GlobalVariable.bRun)
{
lock (GlobalVariable.lockCheckOKID)
{
listCount = GlobalVariable.list_CheckOKID.Count;
}
if (0 == listCount)
{
Thread.Sleep(10);
continue;
}
else
{
lock (GlobalVariable.lockCheckOKID)
{
yf_id = GlobalVariable.list_CheckOKID[0];
GlobalVariable.list_CheckOKID.RemoveAt(0);
}
if (!OperMySql.UpdateCheckState(yf_id, "是"))
{
TriColorLight.ShowRed();
PlatformConnection.Instance.StopWork();
lock (GlobalVariable.lockShowMsgBox)
{
DialogResult result = MsgBoxHelper.ShowWarning("信息上传到远程数据库失败,请检查网络连接,重启软件");
if (result == DialogResult.OK)
{
return;
}
}
}
//if (!GlobalVariable.checking)
//{
// if (!OperMySql.UpdateCheckState(GlobalVariable.list_CheckOKID[0], "是"))
// {
// TriColorLight.ShowRed();
// PlatformConnection.Instance.StopWork();
// lock (GlobalVariable.lockShowMsgBox)
// {
// DialogResult result = MsgBoxHelper.ShowWarning("信息上传到远程数据库失败,请检查网络连接,重启软件");
// return;
// }
// }
// lock (GlobalVariable.lockCheckOKID)
// {
// GlobalVariable.list_CheckOKID.RemoveAt(0);
// }
}
}
}
}
}