private void cerrarSesiónToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Session.Usuario = null;
     var form = new Login.Login();
     form.Location = this.Location;
     form.StartPosition = FormStartPosition.CenterScreen;
     form.Show();
     this.Hide();
 }
Exemplo n.º 2
0
        public RolIngreso(string usuario, Login.LogIn log)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            user = usuario;
            login = log;
            /*CARGAR ROLES*/
            Conexion con1 = new Conexion();
            string query5 = "SELECT DISTINCT R.nombre FROM LPP.ROLES R JOIN LPP.ROLESXUSUARIO U " +
                            "ON U.rol = R.id_rol AND U.username = '******' AND R.habilitado = 1";

            con1.cnn.Open();
            SqlCommand command5 = new SqlCommand(query5, con1.cnn);
            SqlDataReader lector5 = command5.ExecuteReader();

            while (lector5.Read())
            {
                cmbRol.Items.Add(lector5.GetString(0));
            }

            con1.cnn.Close();
        }
Exemplo n.º 3
0
 private void btnSalir_Click(object sender, EventArgs e)
 {
     Login.Login login = new Login.Login();
     login.Show();
     this.Dispose();
 }
Exemplo n.º 4
0
 //  Abre el formulario de Login
 private void lklCerrarSesion_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Login.Login formLogin = new Login.Login(); //  Crea un formulario de Login
     formLogin.Show();                          //  Muestra el formulario de login
     this.Close();                              //  Oculta el formulario principal
 }