Exemplo n.º 1
0
        private void ActualizarPantalla()
        {
            Interface      = new InterfaceUsuario(this);
            lblSesión.Text = "Usuario: " + Usuario;
            RegistroUsuario temp;

            Interface.RecuperarUsuario(Usuario, out temp);
            PantallaLogin.Sesión = temp;
            bool Tarjeta = Interface.ValidarDatosTarjeta(Usuario);

            if (Tarjeta)
            {
                btnAgregarTarjeta.Visible  = lblAgregarTarjeta.Visible = false;
                btnEliminarTarjeta.Visible = btnModificarTarjeta.Visible = lblEliminarTarjeta.Visible = lblModificarTarjeta.Visible = true;
            }
            else
            {
                btnAgregarTarjeta.Visible  = lblAgregarTarjeta.Visible = true;
                btnEliminarTarjeta.Visible = btnModificarTarjeta.Visible = lblEliminarTarjeta.Visible = lblModificarTarjeta.Visible = false;
            }
            if (Interface.EsAdministrador(Usuario))
            {
                lblAdmi.Visible              = btnRegistrarEmpleado.Visible = lblAgregarEmpleado.Visible = btnEliminarUsuario.Visible = lblEliminarUsuario.Visible = true;
                lblUsuario.Location          = new Point(207, 147);
                btnModificarUsuario.Location = new Point(192, 195);
                lblModificarUsuario.Location = new Point(205, 310);
                lblTarjeta.Location          = new Point(649, 147);
                btnAgregarTarjeta.Location   = new Point(634, 195);
                lblAgregarTarjeta.Location   = new Point(652, 310);
                btnModificarTarjeta.Location = new Point(560, 195);
                lblModificarTarjeta.Location = new Point(575, 310);
                btnEliminarTarjeta.Location  = new Point(716, 195);
                lblEliminarTarjeta.Location  = new Point(731, 310);

                Size = new Size(873, 470);
            }
            else
            {
                lblAdmi.Visible = btnRegistrarEmpleado.Visible = lblAgregarEmpleado.Visible = btnEliminarUsuario.Visible = lblEliminarUsuario.Visible = false;

                lblUsuario.Location          = new Point(65, 147);
                btnModificarUsuario.Location = new Point(54, 195);
                lblModificarUsuario.Location = new Point(62, 310);
                lblTarjeta.Location          = !Tarjeta ? new Point(414, 147) : new Point(350, 147);
                btnAgregarTarjeta.Location   = !Tarjeta ? new Point(395, 195) : new Point(331, 195);
                lblAgregarTarjeta.Location   = !Tarjeta ? new Point(410, 310) : new Point(346, 310);
                btnModificarTarjeta.Location = new Point(270, 195);
                lblModificarTarjeta.Location = new Point(285, 310);
                btnEliminarTarjeta.Location  = new Point(395, 195);
                lblEliminarTarjeta.Location  = new Point(410, 310);

                Size = new Size(573, 470);
            }
            this.CenterToScreen();
        }