예제 #1
0
 private void LoginButton_Click(object sender, EventArgs e)
 {
     currentBl.employee.EmployeeID_ = EmployeeIDTextBox.Text;
     currentBl.employee.Password_   = PasswordTextBox.Text;
     if (currentBl.ValidateLogin(currentBl.employee) == true)
     {
         if (Profession(currentBl.employee.Profession_) == 1)
         {
             this.Hide();
             kontrolform = new UIKontrolform(currentBl);
             monitor     = new UIMonitor(currentBl);
             kontrolform.Show();
             monitor.Show();
             nulpunktsjustering = new UINulpunktsjustering();
             var result = nulpunktsjustering.ShowDialog();
             if (result == DialogResult.OK)
             {
                 MessageBox.Show("Nulpunktsjustering påbegyndes");
             }
         }
         if (Profession(currentBl.employee.Profession_) == 2)
         {
             kalibrering = new UIKalibrering(currentBl);
             kalibrering.Show();
             this.Hide();
         }
     }
     else
     {
         MessageBox.Show("Forkert medarbejder id eller kodeord. Prøv igen.");
     }
 }
예제 #2
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            currentBl.employee.EmployeeID_ = EmployeeIDTextBox.Text; //Gemmer id i employee dto'en
            currentBl.employee.Password_   = PasswordTextBox.Text;   //Gemmer password i employee dto'en
            if (currentBl.ValidateLogin(currentBl.employee) == true)
            {
                if (Profession(currentBl.employee.Profession_) == 1) // Hvis medarbejderen er en operationssygeplejerske åbnes nulpunktsjusterings formen
                {
                    this.Hide();

                    nulpunktsjustering = new UINulpunktsjustering(currentBl, this);
                    nulpunktsjustering.Show();
                    EmployeeIDTextBox.Clear();
                    PasswordTextBox.Clear();
                }
                if (Profession(currentBl.employee.Profession_) == 2) // Hvis medarbejeren er en tekniker åbnes kalibreringsformen
                {
                    kalibrering = new UIKalibrering(currentBl, this);
                    kalibrering.Show();
                    this.Hide();
                    EmployeeIDTextBox.Clear();
                    PasswordTextBox.Clear();
                }
            }
            else
            {
                MessageBox.Show("Forkert medarbejder id eller kodeord. Prøv igen."); //viser besked hvis der er noget galt med log in.
            }
        }