예제 #1
0
        private void button_Login_Click(object sender, EventArgs e)
        {
            QueriesTableAdapter queriesTableAdapter = new QueriesTableAdapter();

            int ok = (int)queriesTableAdapter.GetAccountExistence(textBox_Email.Text, textBox_Password.Text);

            if (ok == 0)
            {
                MessageBox.Show(text: "Datele introduse sunt incorecte!",
                                caption: "Atentie!",
                                buttons: MessageBoxButtons.OK,
                                icon: MessageBoxIcon.Warning);
            }
            else
            {
                int Id_User = (int)queriesTableAdapter.GetIdUser_ByEmail(textBox_Email.Text);

                textBox_Email.Text    = "";
                textBox_Password.Text = "";

                if (checkBox_RememberMe.Checked)
                {
                    detaliiTableAdapter.UpdateQuery(checkBox_RememberMe.Checked, Id_User);
                }

                Form_Lobby form = new Form_Lobby(this, Id_User);

                Hide();

                form.Show();
            }
        }
예제 #2
0
        private void Form_Login_Activated(object sender, EventArgs e)
        {
            QueriesTableAdapter queriesTableAdapter = new QueriesTableAdapter();

            detaliiTableAdapter = new DetaliiTableAdapter();

            conectat = (bool)queriesTableAdapter.Get_Conectat();

            if (conectat)
            {
                int Id_User = (int)queriesTableAdapter.Get_Id_User();

                Form_Lobby form = new Form_Lobby(this, Id_User);

                Hide();

                form.Show();
            }
        }