コード例 #1
0
        private void SearchPets(object o)
        {
            if (SearchText == null && SearchType != "All")
            {
                MessageBox.Show("Please enter a search critera");
            }
            else
            {
                stype = SearchType;
                stxt  = SearchText;

                ShopperHome sh = new ShopperHome(LoggedInUser);
                closeWindows();
                sh.Show();
            }
        }
コード例 #2
0
 private void LogIn(object sender, RoutedEventArgs e)
 {
     if (CheckUsernamePassword())
     {
         if (AccountToLogin.Type == "Seller")
         {
             SellerHome sellerHome = new SellerHome(AccountToLogin);
             sellerHome.Show();
             this.Close();
         }
         else if (AccountToLogin.Type == "Shopper")
         {
             ShopperHome shopperHome = new ShopperHome(AccountToLogin);
             shopperHome.Show();
             this.Close();
         }
     }
 }
コード例 #3
0
 private void LogInClicked(object sender, RoutedEventArgs e)
 {
     if (Authenticated())
     {
         User user = Users.FirstOrDefault(x => x.Username == UsernameEntry.Text &&
                                          x.Password == PasswordEntry.Password);
         if (user.Seller)
         {
             SellerHome sellerWindow = new SellerHome(ref user);
             sellerWindow.Show();
             Close();
         }
         else
         {
             ShopperHome shopperWindow = new ShopperHome(ref user);
             shopperWindow.Show();
             Close();
         }
     }
 }