//修改值班人员 private void btnUpdateOperator_Click(object sender, EventArgs e) { if (operatorGrid.SelectedRows.Count == 0) { UMessageBox.Show("请选择数据!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } work_ID = operatorGrid.CurrentRow.Cells[0].Value.ToString(); new EditOperatorInfoForm(false, work_ID).ShowDialog(); DataLoade(CSPNType.OperatorInfo); WebBrower.Reload(); }
//删除 private void btnDelete_Click(object sender, EventArgs e) { int[] n = new int[grid.Rows.Count + 1]; for (int i = 0; i < grid.Rows.Count; i++) { //判断该行的复选框是否存在 if (grid.Rows[i].Cells[0].Value != null) { //判断该复选框是否被选中 if (Convert.ToBoolean(grid.Rows[i].Cells[0].Value)) { n[0]++; n[i + 1] = i; } } } if (n[0] == 0) { UMessageBox.Show("请选择数据!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { if (UMessageBox.Show("是否删除?", "人井监控管理系统", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { for (int i = 1; i < n.Length; i++) { if (n[i] != 0) { terminal_ID = grid.Rows[n[i]].Cells[1].Value.ToString(); wellInfoService.DeleteWellInfo(terminal_ID); wellStateService.DeleteWellCurrentStateInfo(terminal_ID); wellInfoService.DeleteReportInfo(terminal_ID); } } UMessageBox.Show("数据删除成功!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information); WebBrower.Reload(); DataLoade(null); } } }
private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { UMessageBox.Show("导入成功!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information); WebBrower.Reload(); }