Пример #1
0
        private void tabControl1_Click(object sender, EventArgs e)
        {
            if ( tabControl1.SelectedIndex == 1 && type_user == "admin")
            {
                tabControl1.TabPages[1].Show();

            }
            else if(tabControl1.SelectedIndex == 1 && type_user == "caissier")
            {
                tabControl1.TabPages[1].Hide();

                Page_Connexion b = new Page_Connexion("Stock", this);
                b.Show();
                b.FormClosed += b_FormClosed;
                this.Hide();
            }
            else if (tabControl1.SelectedIndex == 3 && type_user == "admin")
            {
                tabControl1.TabPages[3].Show();
            }
            else if (tabControl1.SelectedIndex == 3 && type_user == "caissier")
            {
                tabControl1.TabPages[3].Hide();
                Page_Connexion b = new Page_Connexion("Etat", this);
                b.Show();
                b.FormClosed += b_FormClosed;
                this.Hide();
            }
            /*
             if (tabControl1.SelectedIndex == 1 )
              {
              tabControl1.TabPages[1].Hide();

                Page_Connexion b = new Page_Connexion("Stock",this);
              b.Show();
              b.FormClosed += b_FormClosed;
              this.Hide();

              }
              else if(tabControl1.SelectedIndex == 3)
              {
                tabControl1.TabPages[3].Hide();

                Page_Connexion b = new Page_Connexion("Etat",this);
              b.Show();
              b.FormClosed += b_FormClosed;
              this.Hide();

              }
            */
        }
Пример #2
0
 private void Deconnexion_Click(object sender, EventArgs e)
 {
     Page_Connexion b = new Page_Connexion("Connexion",this);
     b.Show();
     this.Close();
 }