/// <summary> /// Switch the departmentnumber. /// </summary> /// <param name="departmentNumber">Departmentnumber from database</param> /// <param name="userName">Current logged in username</param> private void OpenUserPanel(int departmentNumber, string userName) { switch (departmentNumber) { case 0: AdminPanel adminPanel = new AdminPanel(this, tbUsername.Text); adminPanel.Show(); this.Hide(); break; case 1: DevelopmentMainPanel developmentPanel = new DevelopmentMainPanel(this, tbUsername.Text, true); developmentPanel.Show(); this.Hide(); break; case 2: FinanceMainPanel financePanel = new FinanceMainPanel(this, tbUsername.Text, true); financePanel.Show(); this.Hide(); break; case 3: SalesMainPanelcs salesPanel = new SalesMainPanelcs(this, tbUsername.Text, true); salesPanel.Show(); this.Hide(); break; default: MessageBox.Show("Failed to log in. Are you sure all fields are filled in correctly?", "Error logging in."); break; } }
private void OpenUserPanel(int departmentNumber) { switch (departmentNumber) { case 1: DevelopmentMainPanel developmentPanel = new DevelopmentMainPanel(this, userName, false); developmentPanel.Show(); this.Hide(); break; case 2: FinanceMainPanel financePanel = new FinanceMainPanel(this, userName, false); financePanel.Show(); this.Hide(); break; case 3: SalesMainPanelcs salesPanel = new SalesMainPanelcs(this, userName, false); salesPanel.Show(); this.Hide(); break; } }