Пример #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     instant = EmployeeForm.ReadXML <Employee>(userpath);
     for (int i = 0; i < instant.Count; i++)
     {
         if (usernameUserTB.Text.ToUpper() == instant.ElementAt(i).username.ToUpper())
         {
             valid1 = true;
         }
         if (passwordUserTB.Text.ToUpper() == instant.ElementAt(i).password.ToUpper())
         {
             valid2 = true;
         }
         if (valid1 && valid2)
         {
             i = instant.Count;
             EmployeePortal employeeportal = new EmployeePortal();
             employeeportal.ShowDialog();
             this.Close();
         }
     }
     if (!(valid1))
     {
         userLoginError.Text = "***Unrecognizable username***";
     }
     else
     {
         userLoginError.Text = ""; valid1 = false;
     }
     if (!(valid2))
     {
         userLoginError.Text += "**invalid password***";
     }
     else
     {
         userLoginError.Text += ""; valid2 = false;
     }
 }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            EmployeeForm user = new EmployeeForm();

            user.ShowDialog();
        }