private void timer2_Tick(object sender, EventArgs e) { timer2.Stop(); if (Apertura.Equals("NUEVO")) { frmAperturaCaja aperturaCaja = new frmAperturaCaja(); this.Hide(); aperturaCaja.ShowDialog(); Dispose(); } else { frmMenuPrincipal principal = new frmMenuPrincipal(); this.Hide(); principal.ShowDialog(); Dispose(); } }
private void timer2_Tick(object sender, EventArgs e) { pb.Maximum = 100; if (pb.Value < 100) { pb.Value = pb.Value + 10; } else { pb.Value = 0; timer2.Stop(); var tipoUsuario = lstLoggedUser.Select(x => x.Rol).First(); if (tipoUsuario.Equals("ADMINISTRADOR")) { new DatCatGenerico().Editar_InicioSesion(EncriptarTexto.Encriptar(serialPC), idusuario); this.Hide(); frmDashboard dashboard = new frmDashboard(); dashboard.ShowDialog(); Dispose(); } else { if (Apertura == "NUEVO" & userPermision != "VENDEDOR") { new DatCatGenerico().Editar_InicioSesion(EncriptarTexto.Encriptar(serialPC), idusuario); this.Hide(); frmAperturaCaja frm = new frmAperturaCaja(); frm.ShowDialog(); UserLoginNow = null; nameUserNow = null; } else { this.Hide(); new DatCatGenerico().Editar_InicioSesion(EncriptarTexto.Encriptar(serialPC), idusuario); frmMenuPrincipal principal = new frmMenuPrincipal(); principal.ShowDialog(); UserLoginNow = null; nameUserNow = null; } } } }