コード例 #1
0
        private void clubMaintenance_FormClosing(object sender, FormClosingEventArgs e)
        {
            adminDashboard ad = new adminDashboard();

            ad.Show();
            this.Dispose();
        }
コード例 #2
0
        private void studentRegister_FormClosing(object sender, FormClosingEventArgs e)
        {
            adminDashboard ad = new adminDashboard();

            ad.Show();
            this.Dispose();
        }
コード例 #3
0
 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();
 }
コード例 #4
0
        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!");
                }
            }
        }