Exemple #1
0
 //For signing into an account
 private void Button_SignIn(object sender, RoutedEventArgs e)
 {
     if (!(String.IsNullOrEmpty(userNameTxt.Text) || String.IsNullOrEmpty(passwordtxt.Password)))
     {
         bool userexists = ddb.CheckUsernameExists(userNameTxt.Text);
         if (userexists == true)
         {
             string username = ddb.GetUsername(userNameTxt.Text);
             string password = ddb.GetPassword(userNameTxt.Text);
             if (username == userNameTxt.Text && passwordtxt.Password == password)
             {
                 BookShelf bookShelf = new BookShelf(userNameTxt.Text);
                 bookShelf.Show();
                 bookShelf.Owner = this;
                 this.Hide();
                 userNameTxt.Text     = "";
                 passwordtxt.Password = "";
             }
             else
             {
                 MessageBox.Show("Check your Credentials", "Error !!!!");
             }
         }
     }
     else
     {
         MessageBox.Show("Fill in your credentials", "Error !!!!");
     }
 }