Exemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            Manager_Home_Form home_Form = new Manager_Home_Form(managerID);

            this.Close();
            home_Form.Show();
        }
Exemplo n.º 2
0
        private void login(int id)
        {
            OnlineExam ent = new OnlineExam();

            try
            {
                var dept = (from d in ent.Departments select d).ToList();

                bool isManager = false;

                foreach (var item in dept)
                {
                    if (id == item.MangerId)
                    {
                        isManager = true;
                    }
                }

                if (!isManager)
                {
                    MessageBox.Show("Access Denaied", "Error");
                    return;
                }

                Manager_Home_Form manager_Home = new Manager_Home_Form(id);
                this.Close();
                manager_Home.Show();
            }
            catch (Exception)
            {
                MessageBox.Show("Not Authroized", "Access Denaied");
            }
        }