Esempio n. 1
0
        private void regButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show(CheckData());
            //if
            var profile = new users {
                id = int.Parse(idTextBox.Text), login = loginTextBox.Text, password = passwordTextBox.Password, email = emailTextBox.Text, full_name = fullNameTextBox.Text, type = 2
            };

            context.users.Add(profile);
            context.SaveChanges();
            MainWindow autoWin = new MainWindow();

            autoWin.Show();
            this.Close();
        }
Esempio n. 2
0
        private void changeButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show(CheckData());
            //if
            var profile = new users {
                login = loginTextBox.Text, password = passwordTextBox.Password, email = emailTextBox.Text, full_name = fullNameTextBox.Text
            };

            context.users.Add(profile);
            context.SaveChanges();
            UsersWindow usersWin = new UsersWindow(profile);

            usersWin.Show();
            this.Close();
        }
Esempio n. 3
0
 private void regButton_Click(object sender, RoutedEventArgs e)
 {
     if (CheckData())
     {
         var profile = new users {
             login = loginTextBox.Text, password = passwordTextBox.Password, email = emailTextBox.Text, full_name = fullNameTextBox.Text, type = 2, last_change = DateTime.UtcNow
         };
         context.users.Add(profile);
         context.SaveChanges();
         MessageBoxResult result = new MessageBoxResult();
         result = MessageBox.Show("Вы успешно зарегистрированы", "Регистрация", MessageBoxButton.OK, MessageBoxImage.Information);
         if (result == MessageBoxResult.OK)
         {
             this.Close();
         }
     }
 }
Esempio n. 4
0
 private void changeButton_Click(object sender, RoutedEventArgs e)
 {
     if (CheckData())
     {
         users _newuserdata = new users();
         _newuserdata             = context.users.FirstOrDefault(x => x.id == _podopini.id);
         _newuserdata.full_name   = fullNameTextBox.Text;
         _newuserdata.password    = passwordTextBox.Password;
         _newuserdata.email       = emailTextBox.Text;
         _newuserdata.login       = loginTextBox.Text;
         _newuserdata.last_change = DateTime.UtcNow;
         _podopini = _newuserdata;
         context.SaveChanges();
         UsersWindow usersWin = new UsersWindow(_podopini);
         usersWin.Show();
         this.Close();
     }
 }