Exemple #1
0
 private void Item_Licencia_Click(object sender, EventArgs e)
 {
     Administrador.FormLicencia Licencia = new Administrador.FormLicencia();
     Licencia.lbModifica.Text = txNombreUsu.Text;
     Licencia.ShowDialog();
 }
Exemple #2
0
        private void FormMenu_Load(object sender, EventArgs e)
        {
            this.Hide();
            FormLogin Login = new FormLogin();

            Login.ShowDialog();

            if (Login.Logueado == true)
            {
                txNombreUsu.Text = Login.txNombreUsuario.Text;
                txTipoUsu.Text   = Login.txTipoUsuario.Text;
                this.Show();

                ConsultarLicencia();

                if (Permiso == 1)
                {
                    Item_MenuHabitaciones.Enabled = false;
                    Item_Reportes.Enabled         = false;
                    Item_Administrador.Enabled    = false;
                    Item_Usuario.Enabled          = false;
                    Item_InformacionEmpre.Enabled = false;
                    Item_Licencia.Enabled         = false;
                    Item_Programador.Enabled      = false;

                    if (txTipoUsu.Text == "Programador")
                    {
                        Item_MenuHabitaciones.Enabled = true;
                        Item_Reportes.Enabled         = true;
                        Item_Administrador.Enabled    = true;
                        Item_Usuario.Enabled          = true;
                        Item_InformacionEmpre.Enabled = true;
                        Item_Licencia.Enabled         = true;
                        Item_Programador.Enabled      = true;
                    }
                    else if (txTipoUsu.Text == "Administrador")
                    {
                        Item_MenuHabitaciones.Enabled = true;
                        Item_Reportes.Enabled         = true;
                        Item_Administrador.Enabled    = true;
                        Item_Usuario.Enabled          = true;
                        Item_InformacionEmpre.Enabled = true;
                        Item_Licencia.Enabled         = true;
                    }
                    else if (txTipoUsu.Text == "Defaul")
                    {
                        Item_MenuHabitaciones.Enabled = true;
                        Item_Reportes.Enabled         = true;
                    }
                }
                else
                {
                    Item_MenuHabitaciones.Enabled = false;
                    Item_Reportes.Enabled         = false;
                    Item_Administrador.Enabled    = true;
                    MessageBox.Show("La Licencia a caducado favor actualizar y reiniciar el sistema. \n Correo: [email protected]", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    Administrador.FormLicencia Licencia = new Administrador.FormLicencia();
                    Licencia.lbModifica.Text = txNombreUsu.Text;
                    Licencia.ShowDialog();
                }
            }
            else
            {
                Close();
            }
        }