/////// for testing Remove Me /////// private void testButton_Click(object sender, EventArgs e) { User user = new User(); administratorForm adminForm = new administratorForm(user); this.Hide(); //adminForm.Show(); adminForm.ShowDialog(); this.Close(); }
// open Administrator Form and pass the logged in user object private void openUserForm(User user) { if (user.Role == UserRole.Admin) { administratorForm adminForm = new administratorForm(user); this.Hide(); //adminForm.Show(); adminForm.ShowDialog(); } else if (user.Role == UserRole.ZooKeeper) { ZooKeeperForm zooKeeperForm = new ZooKeeperForm(user); this.Hide(); //adminForm.Show(); zooKeeperForm.ShowDialog(); } else { MessageBox.Show("User Role Not Specified ", "Error ", MessageBoxButtons.OK); } this.Close(); }