Exemple #1
0
        private void mostrarMenu()
        {
            BL.ClsSeguridad ClsSeguridad = new BL.ClsSeguridad();

            try
            {
                dtAccesoFormularios = ClsSeguridad.formulariosPorUsuario();
                foreach (DataRow r in dtAccesoFormularios.Rows)
                {
                    ribbon.Manager.Items[r["etiqueta"].ToString().Trim()].Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #2
0
        private void btnIniciar_Click(object sender, EventArgs e)
        {
            DataTable tblInformacionLogin = new DataTable();

            try
            {
                BL.ClsSeguridad seg = new BL.ClsSeguridad();
                tblInformacionLogin = seg.login(txtUsuario.Text.Trim(), txtContrasena.Text.Trim());
                if (tblInformacionLogin.Rows.Count > 0)
                {
                    ClsGlobals.idUSuario = Convert.ToInt32(tblInformacionLogin.Rows[0]["idUsuario"].ToString());
                    ClsGlobals.usuario   = tblInformacionLogin.Rows[0]["usuario"].ToString();
                    success = true;
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.ToString().Contains("[CC]"))
                {
                    ClsHelper.MensajeSistema(ex.Message);
                    FrmCambiarContrasena frm = new FrmCambiarContrasena();
                    frm.usuario = txtUsuario.Text;
                    frm.ShowDialog();
                }
                else
                {
                    count -= 1;
                    ClsHelper.MensajeSistema(ex.Message + " " + count.ToString() + " intentos restantes");
                    if (count == 0)
                    {
                        Application.Exit();
                    }
                }
            }
        }
        private void btnIniciar_Click(object sender, EventArgs e)
        {
            try
            {
                if (!ClsHelper.camposObligatorios(txtUsuario, txtContrasenaActual, txtContraseñaNueva, txtConfirmacionNueva))
                {
                    return;
                }

                if (txtContraseñaNueva.Text != txtConfirmacionNueva.Text)
                {
                    ClsHelper.MensajeSistema("Las contraseñas no coinciden, verifique por favor.");
                    return;
                }

                BL.ClsSeguridad ClsSeguridad = new BL.ClsSeguridad();
                ClsSeguridad.cambiarContrasena(txtUsuario.Text.Trim(), txtContrasenaActual.Text.Trim(), txtContraseñaNueva.Text.Trim());
                this.Close();
            }
            catch (Exception ex)
            {
                ClsHelper.MensajeSistema(ex.Message);
            }
        }