Beispiel #1
0
        private void DashboardBtn_Click(object sender, EventArgs e)
        {
            ManagerDashboardPage mpr = new ManagerDashboardPage(l);

            this.Visible = false;
            mpr.Visible  = true;
        }
        private void LoginBtn_Click(object sender, EventArgs e)
        {
            LoginRepo lr       = new LoginRepo();
            string    id       = UserTB.Text;
            string    password = PassTB.Text;

            Login l = lr.GetUser(id, password);

            if (l != null)
            {
                if (l.Role == 0)
                {
                    DashboardPage hp = new DashboardPage(l);
                    this.Visible = false;
                    hp.Visible   = true;
                }

                else if (l.Role == 1)
                {
                    ManagerDashboardPage hp = new ManagerDashboardPage(l);
                    this.Visible = false;
                    hp.Visible   = true;
                }

                else if (l.Role == 2)
                {
                    CheffDashboardPage hp = new CheffDashboardPage(l);
                    this.Visible = false;
                    hp.Visible   = true;
                }
                else
                {
                    MessageBox.Show("Access Denied User");
                }
            }
            else
            {
                MessageBox.Show("Invalid User");
            }
        }