Example #1
0
 /// <summary>
 /// 删除平台
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void bt_delet_Click(object sender, EventArgs e)
 {
     if (tb_delet.Text != "")
     {
         this.DGPlatConfig.AllowUserToAddRows = true;
         try
         {
             if (Myadapter_p.DeletePlat(int.Parse(tb_delet.Text)) != 1)
             {
                 MessageBox.Show("删除失败,请检查此ID是否已经删除");
                 // LogHelper.Info("添加平台失败");
             }
             else
             {
                 MessageBox.Show("删除成功");
             }
         }
         catch (Exception)
         {
             MessageBox.Show("删除失败,请检查此ID是否已经删除");
         }
         this.dt_PlateInfoTableAdapter.Fill(this.myDataSet.Dt_PlateInfo);
         this.DGPlatConfig.AllowUserToAddRows = false;
         DGPlatConfig.ClearSelection();
     }
     else
     {
         MessageBox.Show("请输入要删除的主机ID");
     }
 }