示例#1
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;
            }
        }