Beispiel #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         BLmuonsach   dbMS2  = new BLmuonsach();
         BLquanlysach dbQLS2 = new BLquanlysach();
         k = Convert.ToInt32(this.dataGridView6.CurrentRow.Cells[4].Value.ToString());
         int r = dataGridView2.CurrentCell.RowIndex;
         // Lấy MaKH của record hiện hành
         string strquanlysach = dataGridView2.Rows[r].Cells[0].Value.ToString();
         dbMS2.XoaSach(ref err, strquanlysach);
         h = k + 1;
         dbQLS2.CapNhatSach(laymsach.Text, laytde.Text, laytloai.Text, laymnxb.Text, Convert.ToString(h), layvtri.Text, ref err);
         LoadData2();
         LoadData4();
         LoadData5();
         LoadData6();
         MessageBox.Show("TRẢ THANH CONG!");
     }
     catch
     {
         MessageBox.Show("ERROR");
     }
 }