private void enableOrDisableButtons() { try { if (dtBill.Rows[0]["bill_status"].ToString() == "4" || dtBill.Rows[0]["bill_status"].ToString() == "5") { // if bill status is paid/cancelled txtPaid.ReadOnly = true; dgvInv.ReadOnly = true; btnSave.Enabled = false; dgvInv.Columns["btnDel"].Visible = false; txtPaid.Enabled = false; } else { txtPaid.ReadOnly = false; dgvInv.ReadOnly = false; btnSave.Enabled = true; dgvInv.Columns["btnDel"].Visible = true; txtPaid.Enabled = true; } int ret = app.GetBillLockStatus(appointment_id); if (ret > 0) { btnSave.Enabled = false; } } catch (Exception ex) { CommonLogger.Info(ex.ToString()); } }