private void btnResetPassword_Click(object sender, RoutedEventArgs e)
        {
            Method obj = new Method();
            string id = txtID.Text;
            string msg = "";

            
            var vali = obj.getRegisterUser(id);



            if(vali == null)
            {
                msg = "the is no user with that id number please verify if id is correct";
                messageBox(msg);
            }else
            {
                this.Frame.Navigate(typeof(ResetPasswordPage));
            }
          


        }
        private void btnRegister_Click(object sender, RoutedEventArgs e)
        {   
         
           var objvalidate = new validation();
           var objReg = new Method();
           var objRegister = new tblRegister();

            String IDnum,cell, name, surname, homeAddress, email, password, repassword, gender;
            string msg = "";
           // string n = "/n";
            int age;
            IDnum = txtID.Text;
            name = txtName.Text;
            homeAddress = txtHomeAddress.Text;
            email = txtEmail.Text;
            password = txtPassword.Password;
            repassword = txtRe_password.Password;
            surname = txtSurname.Text;
            cell = txtCellnumber.Text;

            
          

            try
            {
                if (IDnum == "" && name == "" && password == "" && surname == "" && cell == "" && email == "")
              {
                  messageBox("all field must be fill with yuor correct details");
              }
             
                   msg += objvalidate.IDValidation(IDnum); 
                   msg += objvalidate.validatePassword(password, repassword);
                     



                 
                       if (objReg.getRegisterUser(IDnum) == null)
                       {
                           gender = objvalidate.getGender(IDnum);
                           age = objvalidate.getAge(IDnum);
                           objReg.setRegister(IDnum, name, surname, email, cell, gender, age, password);

                           messageBox("Thanks you for registering for Emergency Medical Servise");

                           this.Frame.Navigate(typeof(MainPage));
                       }
                       else
                           {
                               messageBox("user already registerd in the system");
                           }
                
            }
            catch (Exception ex)
            {
                messageBox(ex.Message);
            }
            
            
           
        }
        private void btnVerifyUser_Click(object sender, RoutedEventArgs e)
        {

            string id = txtID.Text;
            Method obj = new Method();
            string msg = "";


            var user = obj.getRegisterUser(id);

            if(user == null)
            {

                msg = "please check your id number ";
                messageBox(msg);
            }
            else
            {
                idNum = txtID.Text;
                txtID.IsEnabled = false;
                btnUpdate.IsEnabled = true;
                txtEmail.IsEnabled = true;
                txtSurname.IsEnabled = true;
                txtCellNumber.IsEnabled = true;
                txtHomeAddress.IsEnabled = true;
             
                lblDisplayName.Text = user.Name;
                txtSurname.Text = user.Surname;
                txtEmail.Text = user.Email;
                //txtCellNumber.Text = user.CellNum;
            }


        }