private void Back_button_Click(object sender, EventArgs e)
        {
            Employee_Home eh = new Employee_Home(aa);

            this.Hide();
            eh.Show();
        }
Beispiel #2
0
 private void metroButton1_Click_1(object sender, EventArgs e)
 {
     if (empOrMan == 4)
     {
         Schedule_Manager_Home smg = new Schedule_Manager_Home(aa);
         this.Hide();
         smg.Show();
     }
     else
     {
         Employee_Home eh = new Employee_Home(aa);
         this.Hide();
         eh.Show();
     }
 }
        private void Login_button_Click(object sender, EventArgs e)
        {
            /*if (usernametextbox.Text.Equals("1"))
             * {
             *   FormAdminHome ah = new FormAdminHome();
             *   this.Hide();
             *   ah.Show();
             * }
             * else if (usernametextbox.Text.Equals("2"))
             * {
             *   Manager_Home mh = new Manager_Home();
             *   this.Hide();
             *   mh.Show();
             * }
             * else if (usernametextbox.Text.Equals("3"))
             * {
             *   Employee_Home hh = new Employee_Home();
             *   this.Hide();
             *   hh.Show();
             * }
             * else if (usernametextbox.Text.Equals("4"))
             * {
             *   Schedule_Manager_Home smg = new Schedule_Manager_Home();
             *   this.Hide();
             *   smg.Show();
             * }*/
            employee x = new employee();

            x.employeeId = usernametextbox.Text;
            x.password   = Passwordtextbox.Text;
            x            = x.loginValidation(x);
            string role = x.role;

            if (role.Equals("none"))
            {
                MessageBox.Show("INVALID USERNAME OF PASSWORD");
            }
            else
            {
                if (role.Equals("1"))
                {
                    FormAdminHome ah = new FormAdminHome(x);
                    this.Hide();
                    ah.Show();
                }
                else if (role.Equals("2"))
                {
                    Manager_Home mh = new Manager_Home(x);
                    this.Hide();
                    mh.Show();
                }
                else if (role.Equals("3"))
                {
                    Employee_Home hh = new Employee_Home(x);
                    this.Hide();
                    hh.Show();
                }
                else if (role.Equals("4"))
                {
                    Schedule_Manager_Home smg = new Schedule_Manager_Home(x);
                    this.Hide();
                    smg.Show();
                }
            }
        }