Esempio n. 1
0
        private void viewClub_FormClosing(object sender, FormClosingEventArgs e)
        {
            stdDashboard sd = new stdDashboard(this.usrID);

            sd.Show();
            this.Dispose();
        }
 private void viewClubDetails_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.role == "student")
     {
         stdDashboard sd = new stdDashboard(this.usrid);
         sd.Show();
     }
     else
     {
         adminDashboard ad = new adminDashboard();
         ad.Show();
     }
     this.Dispose();
 }
Esempio n. 3
0
 private void clubAchievementMaintenance_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.role == "student")
     {
         stdDashboard sd = new stdDashboard(this.usrid);
         sd.Show();
         this.Hide();
     }
     else
     {
         viewClubDetails ad = new viewClubDetails(this.clubID, this.usrid, "admin");
         ad.Show();
         this.Hide();
     }
 }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtUserID.Text.Length == 0 || txtPassword.Text.Length == 0)
            {
                MessageBox.Show("Empty entries is not allowed!");
                return;
            }
            int id = 0;

            if (!int.TryParse(txtUserID.Text, out id))
            {
                MessageBox.Show("Please re-enter your user id!");
                return;
            }
            if (cboUserRole.SelectedItem.ToString() == "Admin")
            {
                if (admin.auth(id, txtPassword.Text))
                {
                    adminDashboard ad = new adminDashboard();
                    ad.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Invalid credentials!");
                }
            }
            else
            {
                if (student.auth(id, txtPassword.Text))
                {
                    stdDashboard sd = new stdDashboard(id);
                    sd.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Invalid credentials!");
                }
            }
        }