Esempio n. 1
0
 //删除
 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);
         }
     }
 }
Esempio n. 2
0
 public void DeleteContent()
 {
     if (UMessageBox.Show("是否删除?", "人井监控管理系统", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         if (wellInfoService.DeleteWellInfo(terminal_ID) > 0 && wellStateService.DeleteWellCurrentStateInfo(terminal_ID) > 0 && wellInfoService.DeleteReportInfo(terminal_ID) > 0)
         {
             UMessageBox.Show("数据删除成功!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Information);
             WebBrower.webBrower.ExecuteScriptAsync("deleteMarker", terminal_ID);
         }
         else
         {
             UMessageBox.Show("数据删除失败!", "人井监控管理系统", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }