Пример #1
0
 /// <summary>
 /// 删除功能
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void  除ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (id == 0)
     {
         MessageBox.Show("没有删除的信息");
         return;
     }
     else
     {
         DialogResult result = MessageBox.Show("确认要删除该信息吗?", "消息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
         if (result == DialogResult.OK)
         {
             GuestManager.DeleteGuestById(id);
             MessageBox.Show("删除成功");
             this.dgvGuest.DataSource = GuestManager.GetAllGuests();
         }
     }
 }