Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int aux = 0;

            if (txtUserName.Text == "admi" && txtPassword.Text == "1234")
            {
                FrmPrincipal frmPrincipal = new FrmPrincipal();
                frmPrincipal.Show();
                this.Hide();

                aux = 1;
            }

            foreach (var i in usuarios)
            {
                if (i.Login == txtUserName.Text && i.Contrasenia == txtPassword.Text)
                {
                    if (i is Practicante)
                    {
                        MessageBox.Show("Es practicante");
                        aux = 1;
                    }
                    if (i is Decano)
                    {
                        MessageBox.Show("Es Decano");
                        aux = 1;
                    }
                    if (i is Subdecano)
                    {
                        MessageBox.Show("Es Subdecano");
                        aux = 1;
                    }
                    if (i is Tutor)
                    {
                        MessageBox.Show("Es Tutor");
                        aux = 1;
                    }
                    if (i is Jefe)
                    {
                        MessageBox.Show("Es Jefe");
                        aux = 1;
                    }
                    if (i is JefeDepartamento)
                    {
                        MessageBox.Show("Es Jefe de Departamento");
                        aux = 1;
                    }
                }
            }
            if (aux == 0)
            {
                MessageBox.Show("Las credenciales son incorrectas");
            }
        }
Exemplo n.º 2
0
 public FrmVerEmpresas(FrmPrincipal frm, Practicante practicante)
 {
     InitializeComponent();
     frmPrincipal = frm;
 }