Esempio n. 1
0
        private void BtnEntrar_Click(object sender, EventArgs e)
        {
            NUsuarios nUsuarios = new NUsuarios();

            if (txtUsuario.Text != "" && txtClave.Text != "")
            {
                var cuenta = nUsuarios.Login(txtUsuario.Text, txtClave.Text);
                if (cuenta == null)
                {
                    // Acceso invalido
                    Mensajes.MensajeSimple("Error en acceso", "Sus datos son inválidos", MessageBoxIcon.Error);
                }
                else
                {
                    // Acceso correcto
                    NPermisos.NombreUsuario   = cuenta.NombreUsuario;
                    NPermisos.TipoUsuario     = cuenta.Tipo;
                    NPermisos.IdUsuario       = cuenta.IdPersona;
                    NPermisos.IdPersona       = cuenta.IdPersona;
                    NPermisos.NombrePersona   = cuenta.Nombre;
                    NPermisos.ApellidoPersona = cuenta.Apellido;
                    FrmInicial frmInicial = new FrmInicial();
                    frmInicial.Show();
                    this.Hide();
                }
            }
        }
 private void IncreaseProgressBar(object sender, EventArgs e)
 {
     // Increment the value of the ProgressBar a value of one each time.
     pgbInicial.Increment(1);
     // Display the textual value of the ProgressBar in the StatusBar control's first panel.
     pgbInicial.Text = pgbInicial.Value.ToString() + "% Completed";
     // Determine if we have completed by comparing the value of the Value property to the Maximum value.
     if (pgbInicial.Value == pgbInicial.Maximum)
     {
         // Stop the timer.
         time.Stop();
         ini.Show();
         this.Owner = ini;
         this.Hide();
         MessageBox.Show(System.Windows.Forms.SystemInformation.UserName);
         MessageBox.Show(System.Windows.Forms.SystemInformation.UserDomainName);
     }
 }