Пример #1
0
        private void lblAdmin_Click(object sender, EventArgs e)
        {
            AdminLogin login = new AdminLogin();

            login.ShowDialog();
            if (login.DialogResult == DialogResult.OK)
            {
                Administration administration = new Administration();
                administration.Show();
            }
        }
Пример #2
0
 private void btnInit_Click(object sender, EventArgs e)
 {
     try
     {
         if (validateForm())
         {
             Program.Server.Admin.InitSystem(txtUser.Text, txtPass.Text);
             Program.SID = Program.Server.Admin.LogInAdmin(txtUser.Text, txtPass.Text);
             Visible     = false;
             var administration = new Administration();
             administration.Show();
         }
         lblError.Text    = "Empty user name or passwords do not match";
         lblError.Visible = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Failed to initialize system");
     }
 }