protected void searchButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (isFormValid())
                {
                    AddStudentEntryDao addStudentEntryDao = new AddStudentEntryDao();
                    addStudentEntryDao.RegistraionNo = registrationNoTextBox.Text;

                    SearchStudentByRegistrationNoDal searchStudentByRegistrationNo = new SearchStudentByRegistrationNoDal();
                    DataTable dt = searchStudentByRegistrationNo.StudentSearchByRegistrationNoDB(addStudentEntryDao);
                    if (dt.Rows.Count == 1)
                    {
                        studentRecordsGrid.DataSource = dt;
                        studentRecordsGrid.DataBind();
                    }
                    else
                    {
                        studentRecordsGrid.Visible = false;
                        Response.Write("There are no student found!");
                    }
                }
            }
            catch (Exception r)
            {
                Response.Write(r.Message);
            }
        }
        public void LoadInStudentRecordGrid()
        {
            AddStudentEntryDao addStudentEntryDao = new AddStudentEntryDao();

            addStudentEntryDao.RegistraionNo = registrationNoTextBox.Text;

            SearchStudentByRegistrationNoDal searchStudentByRegistrationNoDal = new SearchStudentByRegistrationNoDal();
            DataTable searchStudent = searchStudentByRegistrationNoDal.StudentSearchByRegistrationNoDB(addStudentEntryDao);

            if (searchStudent.Rows.Count > 0)
            {
                studentRecordsGridView.Visible    = true;
                studentRecordsGridView.DataSource = searchStudent;
                studentRecordsGridView.DataBind();
            }
            else
            {
                Response.Write("No Student Record Found!");
                studentRecordsGridView.Visible = false;
            }
        }
        protected void registrationNoTextBox_TextChanged(object sender, EventArgs e)
        {
            addFeeDao.RegistraionNo = registrationNoTextBox.Text;

            SearchStudentByRegistrationNoDal searchStudentByRegistrationNoDal = new SearchStudentByRegistrationNoDal();
            DataTable dt = searchStudentByRegistrationNoDal.StudentSearchByRegistrationNoDB(addFeeDao);

            if (dt.Rows.Count > 0)
            {
                //nameLabel.Text = dt.Rows[0]["Student_Name"].ToString();
                //emailLabel.Text = dt.Rows[0]["Email"].ToString();
                //courseNameLabel.Text = dt.Rows[0]["Selected_Course"].ToString();
                //courseFeeLabel.Text = dt.Rows[0]["Course_Fee"].ToString();

                //paidFeeLabel.Text = dt.Rows[0]["Paid_Fee"].ToString();
                //remainingFeeLabel.Text = dt.Rows[0]["Remaining_Fee"].ToString();
                //if(Convert.ToInt32(remainingFeeLabel.Text)==0)
                //{
                //    addedFeeTextBox.ReadOnly = true;
                //    addButton.Enabled = false;
                //}

                addFeeDao.StudentName    = dt.Rows[0]["Student_Name"].ToString();
                addFeeDao.Email          = dt.Rows[0]["Email"].ToString();
                addFeeDao.SelectedCourse = dt.Rows[0]["Selected_Course"].ToString();
                addFeeDao.CourseFee      = Convert.ToInt32(dt.Rows[0]["Course_Fee"].ToString());

                if (dt.Rows[0]["Paid_Fee"] != null && dt.Rows[0]["Paid_Fee"].ToString() != "")
                {
                    addFeeDao.PaidFee      = Convert.ToInt32(dt.Rows[0]["Paid_Fee"].ToString());
                    addFeeDao.RemainingFee = Convert.ToInt32(dt.Rows[0]["Remaining_Fee"]);
                }
                else
                {
                    addFeeDao.PaidFee      = 0;
                    addFeeDao.RemainingFee = addFeeDao.CourseFee - addFeeDao.PaidFee;
                }
                nameLabel.Text         = addFeeDao.StudentName;
                emailLabel.Text        = addFeeDao.Email;
                courseNameLabel.Text   = addFeeDao.SelectedCourse;
                courseFeeLabel.Text    = addFeeDao.CourseFee.ToString();
                paidFeeLabel.Text      = addFeeDao.PaidFee.ToString();
                remainingFeeLabel.Text = addFeeDao.RemainingFee.ToString();

                if (addFeeDao.RemainingFee == 0)
                {
                    addedFeeTextBox.ReadOnly = true;
                    addButton.Enabled        = false;
                }
                else
                {
                    addedFeeTextBox.ReadOnly = false;
                    addButton.Enabled        = true;
                }
            }
            else
            {
                nameLabel.Text           = "Not Found!";
                emailLabel.Text          = "Not Found!";
                courseNameLabel.Text     = "Not Found!";
                courseFeeLabel.Text      = "Not Found!";
                paidFeeLabel.Text        = "Not Found!";
                remainingFeeLabel.Text   = "Not Found!";
                addedFeeTextBox.ReadOnly = true;
                addButton.Enabled        = false;
            }
        }