示例#1
0
        private void Login_button_Click(object sender, EventArgs e)
        {
            //sljedece naredbe pociste textBoxove nakon klika

            //pozovi funkciju za provjeru logina
            provjera(Username_textBox.Text.ToString(), Password_textBox.Text.ToString());
            //iz baze uzmi i ime korisnika
            String username = Username_textBox.Text;

            if (provjera(Username_textBox.Text.ToString(), Password_textBox.Text.ToString()) == 0)
            {
                MessageBox.Show("Krivi uneseni podaci, pokušajte ponovo!");
            }
            else if (provjera(Username_textBox.Text.ToString(), Password_textBox.Text.ToString()) == 1)
            {
                this.Hide();
                Form_trgovina f = new Form_trgovina(1, username);
                f.Closed += (s, args) => this.Close();
                f.Show();
            }
            else
            {
                this.Hide();
                Form_trgovina f = new Form_trgovina(2, username);
                f.Closed += (s, args) => this.Close();
                f.Show();
            }
            Username_textBox.Clear();
            Password_textBox.Clear();
        }
        private void Login_button_Click(object sender, EventArgs e)
        {
            string userName = "******";
            string pass     = "******";

            if (Username_textBox.Text == "" || Password_textBox.Text == "")
            {
                MessageBox.Show("You can't leave any ogf the field empty!");
            }
            else if ((Username_textBox.Text == userName) && (Password_textBox.Text == pass))
            {
                MessageBox.Show("Welcome " + userName);
                Username_textBox.Clear();
                Password_textBox.Clear();
            }
            else
            {
                MessageBox.Show("Invalid User Name or Password");
                Username_textBox.Clear();
                Password_textBox.Clear();
                Username_textBox.Focus();
            }
        }
示例#3
0
        private void Enter_button_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            if (Username_textBox.Text != "" && Password_textBox.Text != "")
            {
                if (UserVerifications.VerifyPassword(Username_textBox.Text, Password_textBox.Text))
                {
                    if (UserVerifications.Admin)
                    {
                        SchoolManagementSystem smsForm =
                            new SchoolManagementSystem(this, UserVerifications.GetUserName(Username_textBox.Text));
                        smsForm.Show();

//                var form = new AddForm(AddForm.AddOperationMode.AddTeacher);
//                form.Show();
                    }
                    else
                    {
                        ProgressFrom progress = new ProgressFrom(false, this);
                        progress.Show();
                    }

                    Hide();

                    Username_textBox.Clear();
                    Password_textBox.Clear();
                }
                else
                {
                    MessageBox.Show(UserVerifications.ObtainTextOfError(Username_textBox.Text));
                    Password_textBox.Clear();
                }
            }

            Cursor.Current = Cursors.Default;
        }
 private void Reset_button_Click(object sender, EventArgs e)
 {
     Username_textBox.Clear();
     Password_textBox.Clear();
     Username_textBox.Focus();
 }