Example #1
0
        void CheckData()
        {
            var check = usersEntities.users.FirstOrDefault(x => x.login == loginTextBox.Text && x.password == passwordTextBox.Password);

            if (check == null)
            {
                tryies++;
                MessageBox.Show("Неверно введен логин или пароль");
                if (tryies == 3)
                {
                    signUpButton.IsEnabled = false;
                    regButton.IsEnabled    = false;
                    dt.Start();
                }
                if (tryies > 3)
                {
                    startBlockTime        += 5;
                    BlockTime              = startBlockTime;
                    signUpButton.IsEnabled = false;
                    regButton.IsEnabled    = false;
                    dt.Start();
                }
            }
            else
            {
                UsersWindow usersWindow = new UsersWindow(check);
                usersWindow.Show();
                this.Close();
            }
        }
Example #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();
        }
Example #3
0
        public void CheckData()
        {
            var check = usersEntities.users.FirstOrDefault(x => x.login == loginTextBox.Text && x.password == passwordTextBox.Password);

            if (check == null)
            {
                MessageBox.Show("Неверно введен логин или пароль");
            }
            else
            {
                UsersWindow usersWindow = new UsersWindow(check);
                usersWindow.Show();
                this.Close();
            }
        }
Example #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();
     }
 }