title: Log in/log out/restrictions
body: <p>I have built application in multiple winforms. First form is a login form. When user logs in, it opens him another form, let say form 2, and then from there I have menu strip which takes user further to form 3,4,5 and so on.</p>
  
  <p>What I want is to put a button on a upper right corner and call it LOG OUT.This button will appear on all forms(only not on first one of course), so when user logs in, do what he needs to do, and then to have ability to log out,regardless on what form he is on. When he logs out the first form will pop out again! How can this be done? Is it possible to close form 1 (log in form, parent) and not shut down the whole application (children forms) after log in?</p>
  
  <p>Next thing I need is to put restrictions... What I mean by that is that there will be different type of users, regular ones and admins, which will have more options available. I have done the login part, checked if there is user name and password from database that match e.g. textbox1 and textbox2 but I need some advice to implement what I just described above.</p>
  
  <p>Thanks, Bane   </p>
  
  <pre><code> private void button1_Click(object sender, EventArgs e)
          {
              try
              {
                  SqlConnection con1 = getConnection();
                  con1.Open();
                  SqlCommand com1 = new SqlCommand();
                  com1.Connection = con1;
                  com1.CommandType = CommandType.Text;
                  com1.CommandText = "select * from radnik WHERE username = '" + textBox2.Text + "' AND password = '" + textBox3.Text + "'";
                  SqlDataReader reader = com1.ExecuteReader();
  
                  if (reader.Read())
                  {
                      MessageBox.Show("Uspesno ste se ulogovali!");
                      Form2 form2 = new Form2();
                      form2.Show();
  
                  }
                  else { MessageBox.Show("Doslo je do greske!"); }
              }
  
              catch (Exception ee)
              {
                  MessageBox.Show(ee.StackTrace);
  
              }
              Refresh();
  
          }
  </code></pre>
  
  <p><strong>this checks info for log in</strong></p>
  
  <pre><code> private void stoloviToolStripMenuItem1_Click(object sender, EventArgs e)
      {
          var form3 = new Form3();
          form3.Show();
  
      }
  
      private void stoloviToolStripMenuItem_Click(object sender, EventArgs e)
      {
  
      }
  
      private void sifrarnikToolStripMenuItem_Click(object sender, EventArgs e)
      {
          var form4 = new Form4();
          form4.Show();
      }
  
      private void rezervacijeToolStripMenuItem_Click(object sender, EventArgs e)
      {
          var form6 = new Form6();
          form6.Show();
      }
  
      private void porudzbineToolStripMenuItem_Click(object sender, EventArgs e)
      {
          var form7 = new Form7();
          form7.Show();   
      }
  
      private void magacinToolStripMenuItem_Click(object sender, EventArgs e)
      {
          var form9 = new Form9();
          form9.Show();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
  
          Form1 fr1 = new Form1();
              fr1.Show();
  
      }
  </code></pre>
  
  <p><strong>this just lead user to different winforms</strong></p>