Esempio n. 1
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            int primerInicio = dbConn.obtenerVariableEntera("SELECT COUNT(*) FROM datosEmpleados");

            if (primerInicio == 0)
            {
                message2.lblError.Text     = "ESTA ES SU PRIMERA VEZ INICIANDO \r\nEL SISTEMA, POR FAVOR CREE UN \r\nSUPER USUARIO PARA CONTINUAR.";
                message2.lblError.Font     = new System.Drawing.Font("Balsamiq Sans", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                message2.lblError.Location = new Point(100, 60);
                message2.ShowDialog();
                Form frmRegistro = new frmIngresoAdmin();
                frmRegistro.ShowDialog();
            }
            else if (txtdentidad.Text != String.Empty && txtContrase.Text != String.Empty && primerInicio != 0)
            {
                if (dbConn.comprobarUsuario(txtdentidad.Text, utilidad.EncriptarTexto(txtContrase.Text)))
                {
                    clsVariablesGlobales.NumIdentidad = txtdentidad.Text;
                    IfrmSeleccionarTipoInicio frmTipoI = new IfrmSeleccionarTipoInicio();
                    frmTipoI.Show();
                    this.Hide();
                }
                else
                {
                    message.lblError.Location = new Point(118, 65);
                    message.lblError.Text     = "USUARIO O CONTRASEÑA \r\nINCORRECTOS";
                    message.ShowDialog();
                }
            }
            else
            {
                message.lblError.Location = new Point(129, 65);
                message.lblError.Text     = "INTRODUZCA VALORES";
                message.ShowDialog();
            }
        }