예제 #1
0
    public void GetName()
    {
        GameObject loginTextObject = GameObject.FindGameObjectWithTag(Tags.loginText);

        if (loginTextObject != null)
        {
            loginText = loginTextObject.GetComponent <LoginText>();
        }

        if (PlaytableApiContainer.getStartedScore())
        {
            //AudioManager.setUseVoice (true);

            if (PlaytableApiContainer.setPlayerName(PlaytableApiContainer.getActualPlayerIndex(), keyboard.Text))
            {
                if (loginText != null)
                {
                    loginText.GetNameFromApiContainer();
                }
                keyboard.Close();
                closing = true;
            }
            else
            {
                //repeated PLayer Name Code
                //keyboard.RepeatedName();
            }
        }
    }
예제 #2
0
 public LoginForm()
 {
     InitializeComponent();
     this.CenterToScreen();
     this.TopMost = true;
     LoginText.Focus();
 }
예제 #3
0
        private void AcceptButton_Click(object sender, EventArgs e)
        {
            UserModel changemodel = new UserModel();

            if ((user.Get_Item("Login", LoginText.Text, ConditionType.Equal) == null) || (user.Get_Item("Login", LoginText.Text, ConditionType.Equal).Login == model.Login))
            {
                if ((NameText.Text != "") &&
                    (SurnameText.Text != "") &&
                    (JobBox.Text != "") &&
                    (LoginText.Text != ""))
                {
                    changemodel.Id              = Id;
                    changemodel.Job_Id          = job.Get_Item("Name", JobBox.Text, ConditionType.Equal).Id;
                    changemodel.Name            = NameText.Text;
                    changemodel.Surname         = SurnameText.Text;
                    changemodel.Patronymic      = PatronymicText.Text;
                    changemodel.Permition_Level = LevelBox.SelectedIndex;
                    changemodel.Login           = LoginText.Text;
                    changemodel.Password        = PasswordText.Text;
                    user.Edit(changemodel);
                    MessageBox.Show("Изменения приняты");
                }
                else
                {
                    MessageBox.Show("Не все поля введены");
                }
            }
            else
            {
                MessageBox.Show("Этот логин уже занят!\nВыберите другой.");
                LoginText.Clear();
                back.Refresh_list();
            }
        }
 private void AddButton_Click(object sender, EventArgs e)
 {
     //MessageBox.Show(user.Get_Item("Login", LoginText.Text, ConditionType.Equal).ToString());
     if (user.Get_Item("Login", LoginText.Text, ConditionType.Equal) == null)
     {
         // MessageBox.Show(JobBox.Text);
         if ((NameText.Text != "") &&
             (SurnameText.Text != "") &&
             (JobBox.Text != "") &&
             (LoginText.Text != ""))
         {
             AddModel.Job_Id          = job.Get_Item("Name", JobBox.Text, ConditionType.Equal).Id;
             AddModel.Name            = NameText.Text;
             AddModel.Surname         = SurnameText.Text;
             AddModel.Patronymic      = PatronymicText.Text;
             AddModel.Permition_Level = LevelBox.SelectedIndex;
             AddModel.Login           = LoginText.Text;
             AddModel.Password        = PasswordText.Text;
             AdminAddFreeTime F = new AdminAddFreeTime(this);
             F.Show();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Не все поля введены");
         }
     }
     else
     {
         MessageBox.Show("Этот логин уже занят!\nВыберите другой.");
         LoginText.Clear();
         back.Refresh_list();
     }
 }
예제 #5
0
        private void lblNewUserRegistration_Click(object sender, EventArgs e)
        {
            LoginText.Clear();
            PassText.Clear();
            GroupBoxAuth.Visible         = false;
            GroupBoxRegistration.Visible = true;

            string MyQuery = $"select [password] from [user] where role = 'Модератор'";

            using (SqlConnection conn = new SqlConnection(MyConn))
            {
                using (SqlCommand command = new SqlCommand(MyQuery, conn))
                {
                    try
                    {
                        conn.Open();
                    }
                    catch (System.Data.SqlClient.SqlException)
                    {
                        MessageBox.Show("Проблемы с соединением с сервером БД\nПроверьте подключение", "Авторизация");
                        Application.Exit();
                    }
                    SqlDataReader reader = command.ExecuteReader();
                    while (reader.Read())
                    {
                        PssMdr.Add(reader[0].ToString());
                    }
                    conn.Close();
                }
            }
        }
예제 #6
0
        void ReleaseDesignerOutlets()
        {
            if (ErrorText != null)
            {
                ErrorText.Dispose();
                ErrorText = null;
            }

            if (LoginText != null)
            {
                LoginText.Dispose();
                LoginText = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (SigninButton != null)
            {
                SigninButton.Dispose();
                SigninButton = null;
            }
        }
 public LoginWindow()
 {
     /*new NewNoteMasterWindow().Show();
      * Close();
      */
     InitializeComponent();
     LoginText.Focus();
 }
예제 #8
0
 private void Login(object pb)
 {
     if (LoginText.ToUpper() == "DOMENA" && ((PasswordBox)pb).Password == "domena")
     {
         MainWindow mw = new MainWindow();
         mw.Show();
         this.Close();
     }
 }
예제 #9
0
        private void SignIn_Click(object sender, EventArgs e)
        {
            Hide();
            MainForm mainForm = new MainForm();

            mainForm.StartPosition = FormStartPosition.CenterScreen;
            mainForm.ShowDialog();

            PasswordText.Clear();
            LoginText.Clear();
        }
예제 #10
0
 private void LogoutButton_Click(object sender, RoutedEventArgs e)
 {
     LowerGridPrelogin.Visibility  = Visibility.Visible;
     UpperGridPrelogin.Visibility  = Visibility.Visible;
     LowerGridPostlogin.Visibility = Visibility.Collapsed;
     UpperGridPostlogin.Visibility = Visibility.Collapsed;
     ContactDetailsGrid.Visibility = Visibility.Collapsed;
     LoginText.Clear();
     PasswordText.Clear();
     currentUser = null;
 }
        private void NovayRegistraciy_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string LoginPolzovately1 = LoginText.Text;         //Создание переменных, в которые заносятся значения из TextBox/PasswordBox
                string Parol1            = ParolText.Password;
                string RetryParol1       = RetryParolText.Password;
                string Dolznost1         = DolznkstText.Text;
                string FIO1            = FIOText.Text;
                string DataRozdeniy1   = DenRozdeniyText.Text;
                string NomerTelephona1 = TelephonText.Text;
                string Email1          = EmailText.Text;
                string Pol1            = PolText.Text;

                if (LoginPolzovately1.Length > 3 && Parol1.Length > 8) // Проверка логина и пароля на допустимое кол-во символов
                {
                    if (Parol1 == RetryParol1)                         //Проверка на совпадение паролей
                    {
                        RegistrPerson(LoginPolzovately1, Parol1, Dolznost1, FIO1, DataRozdeniy1, NomerTelephona1, Email1, Pol1);

                        MessageBox.Show("Регистрация успешна", "Регистрация");

                        LoginText.Clear();
                        ParolText.Clear();
                        RetryParolText.Clear();
                        DolznkstText.Clear();
                        FIOText.Clear();
                        DenRozdeniyText.Clear();
                        TelephonText.Clear();
                        EmailText.Clear();
                        PolText.Clear();
                        PerehodNaAvtorizaciy();
                    }
                    else
                    {
                        MessageBox.Show("Пароли не совпадают!", "Регистрация", MessageBoxButton.OK, MessageBoxImage.Information);
                        ParolText.Clear();
                        RetryParolText.Clear();
                    }
                }
                else
                {
                    MessageBox.Show("Логин должен быть больше трех символов.\nПароль должен быть больше восьми символов.", "Регистрация", MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            catch
            {
                MessageBox.Show("Необходимо заполнить все поля", "Регистрация", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
예제 #12
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            LoginText.Focus();
            if (EnterTry == 1)
            {
                btnEnter.Enabled         = false;
                label_timer_expl.Visible = true;
                label_timer.Visible      = true;
                timer1.Start();
                this.timer1.Tick += new System.EventHandler(this.timer_Tick);
            }
            QueryLogin = LoginText.Text;
            QueryPass  = PassText.Text;
            string MyQuery = $"select [role] from [user] where [name_user] = '" + QueryLogin + "'and [password] = '" + QueryPass + "'";

            using (SqlConnection conn = new SqlConnection(MyConn))
            {
                using (SqlCommand command = new SqlCommand(MyQuery, conn))
                {
                    try
                    {
                        conn.Open();
                    }
                    catch (System.Data.SqlClient.SqlException)
                    {
                        MessageBox.Show("Проблемы с соединением с сервером БД\nПроверьте подключение", "Авторизация");
                        return;
                    }
                    SqlDataReader reader = command.ExecuteReader();
                    if (reader.HasRows)
                    {
                        reader.Read();
                        role = reader[0].ToString();
                        BodyProgram form2 = new BodyProgram(this);
                        form2.Show();
                        LoginText.Clear();
                        PassText.Clear();
                        this.Hide();
                    }
                    else
                    {
                        LoginText.Clear();
                        PassText.Clear();
                        EnterTry--;
                        MessageBox.Show($"Проверьте правильность ввода логина/пароля\nРазрешено попыток: {EnterTry}");
                    }
                    conn.Close();
                }
            }
        }
 void ReleaseDesignerOutlets()
 {
     if (bg != null)
     {
         bg.Dispose();
         bg = null;
     }
     if (LoginText != null)
     {
         LoginText.Dispose();
         LoginText = null;
     }
     if (PasswordText != null)
     {
         PasswordText.Dispose();
         PasswordText = null;
     }
 }
예제 #14
0
    public void CancelTheKeyboard()
    {
        GameObject loginTextObject = GameObject.FindGameObjectWithTag(Tags.loginText);

        if (loginTextObject != null)
        {
            loginText = loginTextObject.GetComponent <LoginText>();
        }

        if (PlaytableApiContainer.getStartedScore())
        {
            //AudioManager.setUseVoice (true);
            PlaytableApiContainer.setPlayerName(PlaytableApiContainer.getActualPlayerIndex(), "");
            if (loginText != null)
            {
                loginText.GetNameFromApiContainer();
            }
            keyboard.Close();
            closing = true;
        }
    }
예제 #15
0
        private void SignIn_Click(object sender, EventArgs e)
        {
            string password = PasswordText.Text;
            string username = LoginText.Text;

            try
            {
                Reciever requester = Reciever.Instance;
                if (requester.authenticate(username, password))
                {
                    Hide();
                    MainForm mainForm = new MainForm();
                    mainForm.StartPosition = FormStartPosition.CenterScreen;
                    mainForm.ShowDialog();

                    PasswordText.Clear();
                    LoginText.Clear();
                }
                else
                {
                    var result = MessageBox.Show("Вы ввели неверный логин или пароль",
                                                 "Ошибка!",
                                                 MessageBoxButtons.OK,
                                                 MessageBoxIcon.Error);
                }
            } catch (WebException ex)
            {
                var result = MessageBox.Show("Ошибка подключения:" + ex.Message,
                                             "Ошибка!",
                                             MessageBoxButtons.OK,
                                             MessageBoxIcon.Error);
            } catch (Exception ex)
            {
                var result = MessageBox.Show("Возникла ошибка:" + ex.Message,
                                             "Ошибка!",
                                             MessageBoxButtons.OK,
                                             MessageBoxIcon.Error);
            }
        }
예제 #16
0
        public Login()
        {
#if DEBUG
            this.LoginText = "Admin";
            this.Senha     = "123456";
#endif
            LoginCommand = new Command(
                execute: () =>
            {
                if (LoginText.Trim().Equals("Admin") && Senha.Trim().Equals("123456"))
                {
                    LoginOk();
                    //App.Current.MainPage.Navigation.PushAsync(new Views.Agendar());
                    App.Current.MainPage.Navigation.PushAsync(new Views.SelectSpecialization());
                    Shell.Current.CurrentItem.Items.RemoveAt(0);
                }
                else
                {
                    App.Current.MainPage.DisplayAlert("Alerta", "Não foi possível realizar o login com os dados informados", "Fechar");
                }
            },
                canExecute: () => { return(true); });
        }
예제 #17
0
 private void LoginText_GotFocus(object sender, RoutedEventArgs e)
 {
     LoginText.Clear();
 }
예제 #18
0
 private void Rename_Loaded(object sender, RoutedEventArgs e)
 {
     LoginText.FocusOnMe();
 }
예제 #19
0
 private void CleanText()
 {
     LoginText.Clear();
     PassText.Clear();
     LoginText.Focus();
 }
예제 #20
0
 void Awake()
 {
     loginText = gameObject.GetComponent <LoginText> ();
 }
예제 #21
0
 private void FrameworkElement_OnLoaded(object sender, RoutedEventArgs e)
 {
     LoginText.Focus();
 }
 public RegisterWindow()
 {
     InitializeComponent();
     LoginText.Focus();
 }