예제 #1
0
 private void RegButton_Click(object sender, RoutedEventArgs e)
 {
     if (UserBox.GetLineText(0).Length == 0 && PWBox.Password.Length == 0)
     {
         ErrReg.Content = "Missing information";
     }
     else if (UserBox.GetLineText(0).Length == 0)
     {
         ErrReg.Content = "Missing username";
     }
     else if (PWBox.Password.Length == 0)
     {
         ErrReg.Content = "Missing password";
     }
     else if (PWBox.Password.Length < 6)
     {
         ErrReg.Content = "Invalid password";
     }
     else
     {
         regCont.openData();
         if (regCont.getSuccess())
         {
             reference.wohoo();
             this.Close();
         }
     }
 }
예제 #2
0
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            u = new User(UserBox.GetLineText(0), PwBox.Password);

            if (!Reg_success.Content.Equals(""))
            {
                Error.Content       = "";
                Reg_success.Content = "";
            }
            if (UserBox.GetLineText(0).Length == 0 && PwBox.Password.Length == 0)
            {
                Error.Content = "Login information missing";
            }
            else if (UserBox.GetLineText(0).Length == 0)
            {
                Error.Content = "Missing username";
            }

            else if (PwBox.Password.Length == 0)
            {
                Error.Content = "Missing Password";
            }
            else
            {
                if (existance(u))
                {
                    GlowingEarth ge = GlowingEarth.getInstance();
                    this.Close();
                    ge.Show();
                }
                else
                {
                    Error.Content = "Wrong username or password";
                }
            }
        }
예제 #3
0
 public string getUser()
 {
     return(UserBox.GetLineText(0));
 }