Example #1
0
        private void btnIniciarSesion_Click(object sender, EventArgs e)
        {
            if (Encriptador.CompararMD5(txtPassword.Text, cmbUsuario.SelectedValue.ToString()))
            {
                AppUser u = (AppUser)cmbUsuario.SelectedItem;

                MessageBox.Show("¡Bienvenido!",
                                "HugoApp - Food delivery", MessageBoxButtons.OK, MessageBoxIcon.Information);

                frmPrincipal ventana = new frmPrincipal(u);
                ventana.Owner = this;
                this.Hide();
                ventana.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("¡Contraseña incorrecta!", "Error dialog",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }