コード例 #1
0
        //back
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            EmployeeForm employeeForm = new EmployeeForm();

            employeeForm.ShowDialog();
        }
コード例 #2
0
ファイル: LoginForm.cs プロジェクト: DanPaula/Appointments
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         User tryUSer = userService.GetUser(textBox1.Text, textBox2.Text);
         if (tryUSer == null)
         {
             MessageBox.Show("User invalid");
         }
         if (tryUSer.getRole().Equals("admin"))
         {
             this.Hide();
             AdminForm admin = new AdminForm();
             admin.Show();
         }
         else
         {
             this.Hide();
             EmployeeForm other = new EmployeeForm();
             other.Show();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Conexiune invalida");
     }
 }