Exemple #1
0
        private void Principal_Load(object sender, EventArgs e)
        {
            string departamento = Login.departamento;
            string user         = Login.user;
            string pass         = Login.pass;

            drLogin = blLogin.BL_DatosPersonales(user, pass);
            if (drLogin.Read())
            {
                lblcodigo.Text    = drLogin["IdEmpleado"].ToString();
                lblnombre.Text    = drLogin["Name"].ToString();
                lblapellidos.Text = drLogin["Apellidos"].ToString();
                lblpuesto.Text    = drLogin["job"].ToString();
            }
            drLogin.Close();

            if (departamento == "GER")
            {
                btnalmacen.Enabled      = true;
                btndevoluciones.Enabled = true;
                btnfacturas.Enabled     = true;
                btnalbaranes.Enabled    = true;
                btngestion.Enabled      = true;
                btnlibro.Enabled        = true;

                btnpedidos.Enabled  = true;
                btnclientes.Enabled = true;
                btnnuevo.Enabled    = true;
                btnventas.Enabled   = true;
            }
            if (departamento == "COM")
            {
                btnalmacen.Enabled      = false;
                btndevoluciones.Enabled = false;
                btnfacturas.Enabled     = false;
                btnalbaranes.Enabled    = false;
                btngestion.Enabled      = false;
                btnlibro.Enabled        = false;

                btnpedidos.Enabled  = true;
                btnclientes.Enabled = true;
                btnnuevo.Enabled    = true;
                btnventas.Enabled   = true;
            }
            if (departamento == "ALM")
            {
                btnalmacen.Enabled      = true;
                btndevoluciones.Enabled = true;
                btnfacturas.Enabled     = true;
                btnalbaranes.Enabled    = true;
                btngestion.Enabled      = true;
                btnlibro.Enabled        = true;

                btnpedidos.Enabled  = false;
                btnclientes.Enabled = false;
                btnnuevo.Enabled    = false;
                btnventas.Enabled   = false;
            }
        }