添加用户信息相关
This commit is contained in:
commit
9ce3d975b4
3 files changed
+20
-11
No files matched your search
@@ -186,7 +186,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
drEmployee["WaterLevel"] = _new.GetValue("MTL");
|
||||
drEmployee["Process"] = _new.GetValue("Process");
|
||||
drEmployee["Step"] = _new.GetValue("Step");
|
||||
drEmployee["UserButton"] = _new.GetValue("UserButton");
|
||||
if (_new.GetValue("UserButton").ToString()!="900") drEmployee["UserButton"] = _new.GetValue("UserButton");
|
||||
drEmployee["UserInfo"] = _new.GetValue("UserInfo");
|
||||
drEmployee["WORK_RUN"] = _new.GetValue("WORK_RUN");
|
||||
drEmployee["RUN_STEPID"] = _new.GetValue("RUN_STEPID");
|
||||
drEmployee["CALL"] = _new.GetValue("CALL");
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
void Tick_Event_5S()//Tick_Event周期执行事件5S
|
||||
{
|
||||
for (int i = 0; i < Machinesdata_Count; i++)
|
||||
{
|
||||
{/**发送800指令**/
|
||||
if (Selet_Machines(Machines, "State", "ID='" + i + "'").ToString() == "801")
|
||||
{
|
||||
stringQueue.Enqueue(new QueueString
|
||||
@@ -318,23 +318,23 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
/**染机用户信息**/
|
||||
try
|
||||
{
|
||||
if ((bool)Selet_Machines(Machines, "UserButton", "ID='" + i + "'"))
|
||||
if (Selet_Machines(Machines, "UserButton", "ID='" + i + "'").ToString() == "901")
|
||||
{
|
||||
MainWindow.InfData.Rows.Add(new object[] {
|
||||
Selet_Machines(Machines, "Name", "ID='" + i + "'"),
|
||||
Properties.Resources.Pequest + Selet_Machines(Machines, "UserInfo", "ID='" + i + "'"),
|
||||
Selet_Machines(Machines, "SYSKEY", "ID='" + i + "'"),
|
||||
Selet_Machines(Machines, "ID", "ID='" + i + "'")});
|
||||
Updata_Machines(Machines, "UserButton", "ID='" + i + "'", "900");
|
||||
}
|
||||
if (Selet_Machines(Machines, "UserButton", "ID='" + i + "'").ToString() == "902")
|
||||
{
|
||||
MainWindow.InfData.Select("ID='" + i + "'").First().Delete();
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
}//发送800指令
|
||||
|
||||
|
||||
|
||||
// MainWindow.InfData.Rows.Add(new object[] { "1", Properties.Resources.Pequest+"a", "423", "12" });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
void Tick_Event_60S()
|
||||
@@ -370,6 +370,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
Updata_Machines(Machines, "WaterLevel", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "0");
|
||||
Updata_Machines(Machines, "WORK_RUN", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "-1");
|
||||
Updata_Machines(Machines, "ERR", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "False");
|
||||
Updata_Machines(Machines, "UserButton", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "900");
|
||||
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
|
||||
, Selet_Machines(Machines, "IP", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString()
|
||||
, Selet_Machines(Machines, "PORT", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString());
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
|
||||
}
|
||||
public void CountDown()
|
||||
{
|
||||
timers.Interval = TimeSpan.FromSeconds(10);//秒
|
||||
timers.Interval = TimeSpan.FromSeconds(5);//秒
|
||||
timers.Tick += DisTimer_S;
|
||||
timers.Start();
|
||||
}//时间周期初始化
|
||||
@@ -68,18 +68,25 @@ namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
|
||||
MainWindow.InfData.Rows[0][1].ToString());//播报
|
||||
inf_cont = 0;
|
||||
}
|
||||
|
||||
if (MainWindow.InfData.Rows.Count == 0) { this.Close(); }
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var button = sender as Button;
|
||||
DataRowView datarow = (DataRowView)button.Tag;
|
||||
var id= datarow.Row.Field<int>("ID");
|
||||
var id = datarow.Row.Field<int>("ID");
|
||||
MainWindow.InfData.Select("ID='" + id + "'").First().Delete();
|
||||
|
||||
Griddata.ItemsSource = MainWindow.InfData.DefaultView;
|
||||
if (MainWindow.InfData.Rows.Count == 0) { this.Close(); }
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user