Ejemplo n.º 1
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     if (status != "Admin")
     {
         lf = new LoginForm();
         if (lf.ShowDialog() == DialogResult.Yes)
         {
             this.setStatus("Admin", lf.login);
         }
         else
         {
             return;
         }
     }
     if (status == "Admin")
     {
         ap = new AdminPanel(this.currentLogin);
         this.Hide();
         DialogResult dr = ap.ShowDialog();
         if (dr == DialogResult.Cancel)
         {
             this.Close();
         }
         else if (dr == DialogResult.Abort)
         {
             this.setStatus("Guest");
         }
         cinemaCheckBox.Checked = timeCheckBox.Checked = dateCheckBox.Checked = genreCheckBox.Checked = false;
         this.Show();
     }
 }
Ejemplo n.º 2
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     if (status != "Admin")
     {
         lf = new LoginForm();
         if (lf.ShowDialog() == DialogResult.Yes)
         {
             MessageBox.Show("Привет, Билл!", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
             this.setStatus("Admin", lf.login);
         }
         else
         {
             MessageBox.Show("Вы не Билл Гейтс", "Не успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         return;
     }
     if (status == "Admin")
     {
         ap.currentLoginLabel.Text = this.currentLogin;
         this.Hide();
         DialogResult dr = ap.ShowDialog();
         if (resultListView.Items.Count != 0)
         {
             this.buttonSearch_Click(null, null);
         }
         if (dr == DialogResult.Cancel)
         {
             this.Close();
         }
         else if (dr == DialogResult.Abort)
         {
             this.setStatus("Guest");
         }
         cinemaCheckBox.Checked = timeCheckBox.Checked = dateCheckBox.Checked = genreCheckBox.Checked = false;
         this.Show();
     }
 }