private void btnAdd_Click(object sender, EventArgs e) { string admno = txtAdmNo.Text; Fee f = new Fee(); if (txtAdmNo.Text == "") { MessageBox.Show("Enter Admission Number", "Admission No.", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DataTable dt = f.TransactionStatus(Convert.ToInt16(txtAdmNo.Text)); if (dt.Rows.Count > 0) { if (dt.Rows[0]["Status"].ToString() == "Fee Slip Issued") { MessageBox.Show("Sorry You Can't Make New Transaction, first Cancel or Pay last transaction", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop); } else { frmAEFeeAdmission frm = new frmAEFeeAdmission(admno); if (frm.ShowDialog() == DialogResult.OK) { LoadList(); } } } else { frmAEFeeAdmission frm = new frmAEFeeAdmission(admno); if (frm.ShowDialog() == DialogResult.OK) { LoadList(); } } } }