コード例 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            admin a = new admin();

            a.Show();
            this.Close();
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
            admin q = new admin();

            q.Show();
        }
コード例 #3
0
        private void bunifuFlatButton1_Click(object sender, EventArgs e)
        {
            this.Close();
            admin ad = new admin();

            ad.Show();
        }
コード例 #4
0
        private void bunifuImageButton1_Click(object sender, EventArgs e)
        {
            admin r = new admin();

            r.Show();
            this.Close();
        }
コード例 #5
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (loginfo.counter == 1)
     {
         admin er = new admin();
         er.Show();
         this.Close();
     }
     else if (loginfo.counter == 2)
     {
         cashierHome ass = new cashierHome();
         ass.Show();
         this.Close();
     }
 }
コード例 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (ctr == 2)
            {
                MessageBox.Show("you have one try left to login");
                ctr--;
            }

            if (ctr == 0)
            {
                MessageBox.Show("You have tried to Login Many Times, What's Wrong with you?");
                this.Close();
            }


            else if (textBox1.Text != "" && textBox2.Text != "")
            {
                // CASHIER
                if (comboBox1.Text == "Cashier")
                {
                    try
                    {
                        if (connDB.Clogin(textBox1.Text, textBox2.Text, comboBox1.Text))
                        {
                            loginfo.uname = textBox1.Text;
                            MessageBox.Show("Welcome Cashier: " + textBox1.Text.ToUpper());
                            cashierHome cs = new cashierHome();
                            cs.Show();
                            this.Hide();
                            login = true;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

                    if (login == false)
                    {
                        --ctr;
                        MessageBox.Show("Invalid Login Details");
                    }
                }

                //ADMIN
                if (comboBox1.Text == "Admin")
                {
                    try
                    {
                        if (connDB.Clogin(textBox1.Text, textBox2.Text, comboBox1.Text))
                        {
                            loginfo.uname = textBox1.Text;
                            MessageBox.Show("Welcome Admin: " + textBox1.Text.ToUpper());
                            admin ad = new admin();
                            ad.Show();
                            this.Hide();
                            login = true;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

                    if (login == false)
                    {
                        ctr--;
                        MessageBox.Show("Invalid Login Details");
                    }
                }
            }
            else
            {
                MessageBox.Show("Logging in without details? BRUHHH.");
                ctr--;
            }
        }