Beispiel #1
0
 private void btn_xoa1_Click(object sender, EventArgs e)
 {
     if (dg_khachhang.SelectedRows.Count > 0)
     {
         DialogResult = MessageBox.Show("Bạn Có Chắc Muốn Xóa ID :" + dg_khachhang.CurrentRow.Cells[0].Value.ToString() + " ? ", "Thông Báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
         if (DialogResult == DialogResult.OK)
         {
             if (kh.Delete_KH(dg_khachhang.CurrentRow.Cells[0].Value.ToString()))
             {
                 MessageBox.Show("Xóa Thành Công");
                 dg_khachhang.DataSource = kh.getall_kh();
                 loaddata();
             }
             else
             {
                 MessageBox.Show("Xóa Thất Bại ");
             }
         }
     }
     else
     {
         MessageBox.Show("Vui Lòng Chọn Khách Hàng Bạn Muốn Xóa");
     }
 }