Exemple #1
0
        private void btn_Xoa_Click(object sender, EventArgs e)
        {
            string user = Properties.Settings.Default.useName;
            string pass = Properties.Settings.Default.passWord;

            if (user.Equals("Empty") && pass.Equals("Empty"))
            {
                Login frm = new Login();
                frm.ShowDialog();
            }
            else
            {
                if (dgv_dsdia.SelectedRows.Count > 0)
                {
                    int id = Convert.ToInt32(txt_iddia.Text);
                    if (dVDBUL.FindDVDById(id).trangThai != -1)
                    {
                        MessageBox.Show("Không thể xoá đĩa. Do đĩa đó đang được cho thuê hoặc đặt trước");
                        return;
                    }
                    dVDBUL.DeleteDVD(id);
                    LoadData();
                    MessageBox.Show("Xóa thành công");
                }
                else
                {
                    MessageBox.Show("Vui lòng chọn đĩa bạn muốn xóa");
                }
            }
        }
Exemple #2
0
 private void btn_Xoa_Click(object sender, EventArgs e)
 {
     if (dgv_dsdia.SelectedRows.Count > 0)
     {
         int id = Convert.ToInt32(txt_iddia.Text);
         dVDBUL.DeleteDVD(id);
         LoadData();
         MessageBox.Show("Xóa thành công");
     }
     else
     {
         MessageBox.Show("Vui lòng chọn đĩa bạn muốn xóa");
     }
 }