예제 #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (OptionComboBox.SelectedItem.ToString() == "Edit name")
     {
         ur.UpdateField(Nick, "Name", EditNewData.Text);
     }
     else if (OptionComboBox.SelectedItem.ToString() == "Edit surname")
     {
         ur.UpdateField(Nick, "Surname", EditNewData.Text);
     }
     else if (OptionComboBox.SelectedItem.ToString() == "Edit mail")
     {
         if (uS.CheckMail2(EditNewData.Text))
         {
             ur.UpdateField(Nick, "Mail", EditNewData.Text);
         }
         else
         {
             EditNewData.Text = "";
         }
     }
     else if (OptionComboBox.SelectedItem.ToString() == "Edit nickname")
     {
         if (uS.CheckNick(EditNewData.Text))
         {
             ur.UpdateField(Nick, "Nick", EditNewData.Text);
         }
         else
         {
             EditNewData.Text = "";
         }
     }
 }
예제 #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            User user = new User();

            user = ur.GetUserByNick(PersonNickName.Text);
            if (us.CheckNick(user.Nick) == false)
            {
                SearchWindow main = new SearchWindow(user.Nick, Nick)
                {
                    WindowStartupLocation = WindowStartupLocation.CenterScreen
                };
                main.ShowDialog();
            }
            else
            {
                PersonNickName.Text = "";
            }
        }
예제 #3
0
 private void Reg(object sender, RoutedEventArgs e)
 {
     if (PasswordReg.Password.ToString() == PasswordReg2.Password.ToString() && us.CheckNick(NickName.Text) && us.CheckMail2(Mail.Text))
     {
         User users = new User();
         Info info  = new Info();
         users.Nick   = NickName.Text;
         users.Pass   = PasswordReg.Password.ToString();
         info.Name    = Name.Text;
         info.Surname = Surname.Text;
         info.Mail    = Mail.Text;
         users.person = info;
         Ur.Add(users);
         MainWindow main = new MainWindow()
         {
             WindowStartupLocation = WindowStartupLocation.CenterScreen
         };
         main.ShowDialog();
         this.Close();
     }
     else
     {
         NickName.Text = "";
         Name.Text     = "";
         Surname.Text  = "";
         Mail.Text     = "";
     }
 }