Beispiel #1
0
        private void donneesToolStrip_Click(object sender, EventArgs e)
        {
            var formOuvert = new Form();
            string nomButton = ((ToolStripMenuItem)sender).Name;

            switch (nomButton)
            {
                case "btnSysExpToolStrip":
                    formOuvert = new frmGesSysExp();
                    break;
                case "btnPlateToolStrip":
                    formOuvert = new frmGesPlateforme();
                    break;
                case "btnJeuToolStrip":
                    formOuvert = new frmGestJeu();
                    break;
                case "btnClassToolStrip":
                    formOuvert = new frmGestClassification();
                    break;
                case "btnGenreToolStrip":
                    formOuvert = new frmGesGenre();
                    break;
                case "btnThemeToolStrip":
                    formOuvert = new frmGestTheme();
                    break;
                case "btnVersionToolStrip":
                    formOuvert = new frmGestVersion();
                    break;
                case "btnModeToolStrip":
                    formOuvert = new frmGesMode();
                    break;
                case "btnDecoToolStrip":
                    formOuvert = new frmGesCon();
                    break;
                case "btnCategToolStrip":
                    formOuvert = new frmGesCategorie();
                    break;
                default:
                    break;
            }
            this.Hide();
            formOuvert.Show();
            formOuvert.Closed += (s, args) => this.Close();
        }
Beispiel #2
0
        private void CacheDroit(string _rol)
        {
            switch (_rol)
            {
                case "Administrateur": // accès à tout
                    var formOuvert = new frmGesEmp(UserNm);
                    this.Hide();
                    formOuvert.Show();
                    formOuvert.VerifierNouveauxEmp();
                    formOuvert.Closed += (s, args) => this.Close();
                    break;
                case "Chef de projet":
                    toolStripMenuItem3.Visible = false;
                    var formOuvert1 = new frmGesEmp(UserNm);
                    this.Hide();
                    formOuvert1.Show();
                    formOuvert1.Closed += (s, args) => this.Close();
                    break;
                case "Chef d’équipe":
                    toolStripMenuItem3.Visible = false;
                    var formOuvert2 = new frmGesEmp(UserNm);
                    this.Hide();
                    formOuvert2.Show();
                    formOuvert2.Closed += (s, args) => this.Close();
                    break;
                case "Testeur":
                    toolStripMenuItem1.Visible = false;
                    toolStripMenuItem3.Visible = false;

                    var formOuvert6 = new frmGestJeu(UserNm);
                    this.Hide();
                    formOuvert6.Show();
                    formOuvert6.Closed += (s, args) => this.Close();
                    break;
                case "Agente de bureau":
                    btnSysExpToolStrip.Visible = false;
                    btnPlateToolStrip.Visible = false;
                    btnCategToolStrip.Visible = false;
                    btnClassToolStrip.Visible = false;
                    btnGenreToolStrip.Visible = false;
                    btnModeToolStrip.Visible = false;
                    btnThemeToolStrip.Visible = false;
                    typeDeTestToolStripMenuItem.Visible = false;
                    toolStripMenuItem3.Visible = false;

                    var formOuvert3 = new frmGesEmp(UserNm);
                    this.Hide();
                    formOuvert3.Show();
                    formOuvert3.Closed += (s, args) => this.Close();
                    break;
                case "Directeur de compte":
                    btnSysExpToolStrip.Visible = false;
                    btnPlateToolStrip.Visible = false;
                    btnCategToolStrip.Visible = false;
                    btnClassToolStrip.Visible = false;
                    btnGenreToolStrip.Visible = false;
                    btnModeToolStrip.Visible = false;
                    btnThemeToolStrip.Visible = false;
                    typeDeTestToolStripMenuItem.Visible = false;
                    toolStripMenuItem3.Visible = false;

                    var formOuvert5 = new frmGesEmp(UserNm);
                    this.Hide();
                    formOuvert5.Show();
                    formOuvert5.Closed += (s, args) => this.Close();
                    break;
                case "PDG":
                    var formOuvert4 = new frmGesEmp(UserNm);
                    this.Hide();
                    formOuvert4.Show();
                    formOuvert4.Closed += (s, args) => this.Close();
                    break;
                default:
                    btnMenuDonneToolStrip.Visible = false;
                    toolStripMenuItem1.Visible = false;
                    toolStripMenuItem3.Visible = false;
                    break;
            }
        }