Ejemplo n.º 1
0
        /// <summary>
        /// funkcja logowania uruchamiająca się po naciśnięciu odpowiedniego przycisku
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Login_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(userTextBox.Text))
            {
                MessageBox.Show("Input userename and/or password!");
                return;
            }

            StringBuilder readable = Operations.Login(_stream, userTextBox.Text, passTextBox.Text);

            if (readable[0] == '1')
            {
                MessageBox.Show("Login Succesful.");
                this.Hide();
                FuncForm ff = new FuncForm(this, _stream, userTextBox.Text);
                ff.Show();
            }
            else if (readable[0] == '2')
            {
                MessageBox.Show(" Someone is already logged in");
            }
            else
            {
                MessageBox.Show("Wrong username or password.");
            }
        }
Ejemplo n.º 2
0
        private void Login_Click(object sender, EventArgs e)
        {
            StringBuilder readable = Operations.Login(_stream, userTextBox.Text, passTextBox.Text);

            if (readable[0] == '1')
            {
                MessageBox.Show("Login Succesful.");
                this.Hide();
                FuncForm ff = new FuncForm(this, _stream);
                ff.Show();
            }
            else
            {
                MessageBox.Show("Wrong username or password.");
            }
        }