private void AddStudent_Submit_Btn_Click(object sender, RoutedEventArgs e)
        {
            if (FirstName.Text == "" || LastName.Text == "" || Dob.Text == "" || Gender.Text == "" | AdmDate.Text == "" || AdmNo.Text == "" || ParentContact.Text == "" || ParentName.Text == "")
            {
                MessageBox.Show("You have left out a field");
            }
            else
            {
                try
                {
                    var addStudent = new AddStudent();

                    addStudent.FirstName = FirstName.Text;
                    addStudent.LastName = LastName.Text;
                    addStudent.DofBirth = Dob.Text;
                    addStudent.Gender = Gender.Text;
                    addStudent.AdmNo = AdmNo.Text;
                    addStudent.AdmDate = AdmDate.Text;
                    addStudent.ParentName = ParentName.Text;
                    addStudent.ParentContact = ParentContact.Text;
                    addStudent.New();
                    PageClear();
                }
                catch (Exception ex)
                {
                    var exceptionmessage = ex.Message.ToString();
                    MessageBox.Show("Error occured while trying to write to the database. Check the input values and try again. Error Message: " + exceptionmessage);
                }
            }
        }
 private void adm_no_txtbx_TextChanged(object sender, TextChangedEventArgs e)
 {
     var stdnt = new AddStudent();
     var dict = stdnt.RetrieveDetails(AdmNoTxtbx.Text);
     try
     {
         FirstName.Text = dict["first_name"];
         LastName.Text = dict["last_name"];
     }
     catch
     {
     }
 }
        private void StudentDetail_Tbx_KeyUp(object sender, TextChangedEventArgs e)
        {
            var stdnt = new AddStudent();
            var dict=stdnt.RetrieveDetails(AdmNoModify.Text);
            try
            {
                FirstNameModify.Text = dict["first_name"];
                LastNameModify.Text = dict["last_name"];
                DobModify.Text = dict["dof_birth"];
                GenderModify.Text = dict["gender"];
                AdmDateModify.Text = dict["adm_date"];
                ParentNameModify.Text = dict["parent_name"];
                ParentContactModify.Text = dict["parent_contact"];
            }
            catch
            {

            }
        }