Exemplo n.º 1
0
 private void btnAccept_Click(object sender, EventArgs e)
 {
     try
     {
         int             selectedrowindex = dgvView.SelectedCells[0].RowIndex;
         DataGridViewRow selectedRow      = dgvView.Rows[selectedrowindex];
         //MessageBox.Show(selectedRow.Cells[0].Value.ToString());
         if (selectedRow.Cells[0].Value != null && selectedRow.Cells[0].Value.ToString() != string.Empty)
         {
             string           value  = selectedRow.Cells[0].Value.ToString();
             bool             result = bus.UpdateLoanStatusByLoanID(value, 1);
             string           BookID = selectedRow.Cells[2].Value.ToString();
             BUS.InventoryBUS invBUS = new BUS.InventoryBUS();
             invBUS.UpdateInventoryStatusByBookID(BookID, 0);
             if (result)
             {
                 LoadData();
                 MessageBox.Show("Update Loan Table successful!!!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show("Update Loan Table fail!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     catch (Exception ex)
     {
     }
 }