Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string user = textBox1.Text;
            string pass = textBox2.Text;

            MessageBox.Show(user + pass);
            //tolong ini nanti buat user admin ya win huehehehe
            if (user == pass && user.ToUpper() == "ADMIN")
            {
                this.Hide();
                MainAdmin mm = new MainAdmin();
                mm.ShowDialog();
                this.Close();
            }
            else
            {
                string role = "";
                for (int i = 0; i < tabeluser.Rows.Count; i++)
                {
                    Console.WriteLine(tabeluser.Rows[i].ItemArray[0].ToString() + tabeluser.Rows[i].ItemArray[1].ToString() + tabeluser.Rows[i].ItemArray[2].ToString());
                    if (user == tabeluser.Rows[i].ItemArray[0].ToString() && pass == tabeluser.Rows[i].ItemArray[1].ToString())
                    {
                        role = tabeluser.Rows[i].ItemArray[2].ToString();
                    }
                }
                MessageBox.Show(role);
                if (role != "")
                {
                    if (role == "CUSTOMER")
                    {
                        this.Hide();
                        MainClient mc = new MainClient(user.ToUpper());
                        mc.ShowDialog();
                        this.Close();
                    }
                    else if (role == "FRONT OFFICE")
                    {
                        this.Hide();
                        Front_Office.FrontOfficeParent mf = new Front_Office.FrontOfficeParent();
                        mf.ShowDialog();
                        this.Close();
                    }
                    else if (role == "MANAGER")
                    {
                        this.Hide();
                        Manager.MainManager mc = new Manager.MainManager(user.ToUpper(), conn);
                        mc.ShowDialog();
                        this.Close();
                    }/*
                      * if (role == "ADMIN")
                      * {
                      * this.Hide();
                      * MainClient mc = new MainClient();
                      * mc.ShowDialog();
                      * this.Close();
                      * }*/
                }
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            MainAdmin mm = new MainAdmin();

            this.Hide();
            mm.ShowDialog();
            this.Close();
        }