private void dome()//完 成 { if (svstatus.Text == "Status:successful") { timer1.Enabled = false; panel2.Visible = false; pageset(); PB.Maximum = 100; PB.Value = 100; Perlabel.Text = "100%"; sendmessage($"Completed#{StationLab.Text}#{tempgvid}#{Perlabel.Text}"); label2.Text = "Model"; button4.Visible = false; string StrSql = $"exec sp_UpdateStationStatus '{StationLab.Text}'"; if (AdoInterface.InsertData(StrSql) == 0) { MessageBox.Show("数据库连接失败,无法更新状态!"); } label5.Text = "00:00"; label7.Text = "00:00"; } else { MessageBox.Show("服务端连接失败,请重试!"); Tryconnect(); } }
private void GridView_CellContentClick(object sender, DataGridViewCellEventArgs e)//gridview点击事件 { if (GridView.RowCount > 0) { if (e.ColumnIndex == 3) { if (svstatus.Text == "Status:successful") { if (bl) { string StrSql = null; if (GridView.CurrentRow.Cells["EntBut"].Value.ToString() != "完 成") { for (int i = 0; i < GridView.RowCount; i++) { if (GridView.Rows[i].Cells["EntBut"].Value.ToString() == "进行中...") { GridView.Rows[i].Cells["EntBut"].Value = "完 成"; GridView.Rows[i].Cells["bs"].Value = imageList1.Images[1]; StrSql =$"{StrSql} exec sp_UpdateTempStepStatus '{int.Parse(GridView.Rows[i].Cells["ID"].Value.ToString())}','完 成','{StationLab.Text.Trim()}';"; } } GridView.CurrentRow.Cells["EntBut"].Value = "进行中..."; GridView.CurrentRow.Cells["bs"].Value = imageList1.Images[0]; tempgvid = GridView.CurrentRow.Cells["ID"].Value.ToString(); timecalibration(); string str = $"Operational#{StationLab.Text}#{GridView.CurrentRow.Cells["ID"].Value.ToString()}#{Perlabel.Text}"; sendmessage(str); gmeg = str; StrSql = $"{StrSql} exec sp_UpdateTempStepStatus '{int.Parse(tempgvid)}','进行中...','{StationLab.Text.Trim()}';"; if (AdoInterface.InsertData(StrSql) == 0) { MessageBox.Show("数据库连接失败,无法更新状态!"); } sicconfig(int.Parse(GridView.CurrentRow.Cells["ID"].Value.ToString())); } else { MessageBox.Show("已经完成不可以再点"); } } else { MessageBox.Show("有异常信息在进行中"); } } else { Tryconnect(); } } } }
private void ModelSave_Click(object sender, EventArgs e) { string StrSql = $"sp_UpdateStation '{StationSetCombo.Text }','{Dns.GetHostName()}'"; if (AdoInterface.InsertData(StrSql) == 1) { MessageBox.Show("Station绑定成功,请重新启动程序!"); Close(); Dispose(); Application.Exit(); } // Properties.Settings.Default.Station = StationSetCombo.Text; // Properties.Settings.Default.Save(); // Close(); }
private void timer3_Tick(object sender, EventArgs e)//异常计时 { if (label3.Text != "") { yctime++; button3.Text = $"异 常 {yctime}"; } else { timer3.Enabled = false; button3.Text = "异 常"; string StrSql = $"exec sp_UpdateWaitingTime '{yctime}','{StationLab.Text}'"; if (AdoInterface.InsertData(StrSql) == 0) { MessageBox.Show("数据库连接失败,无法更新状态!"); } yctime = 0; } }