Beispiel #1
0
        private void Empleados_Click(object sender, EventArgs e)
        {
            FrmMantEmpleados oFrmMantEmpleados = new FrmMantEmpleados();

            oFrmMantEmpleados.Show(this);
        }
Beispiel #2
0
        private void FrmSeguridad_Load(object sender, EventArgs e)
        {
            if (VerificarEmpleadosIngresados() == true)
            {
                try
                {
                    VistaConstants.SetWindowTheme(lstRoles.Handle, "explorer", null); //Explorer style
                    VistaConstants.SendMessage(lstRoles.Handle, VistaConstants.LVM_SETEXTENDEDLISTVIEWSTYLE, VistaConstants.LVS_EX_DOUBLEBUFFER, VistaConstants.LVS_EX_DOUBLEBUFFER);
                    VistaConstants.SetWindowTheme(LstRolesXUsuario.Handle, "explorer", null); //Explorer style
                    VistaConstants.SendMessage(LstRolesXUsuario.Handle, VistaConstants.LVM_SETEXTENDEDLISTVIEWSTYLE, VistaConstants.LVS_EX_DOUBLEBUFFER, VistaConstants.LVS_EX_DOUBLEBUFFER);
                    VistaConstants.SetWindowTheme(LstUsuarioEmpleado.Handle, "explorer", null); //Explorer style
                    VistaConstants.SendMessage(LstUsuarioEmpleado.Handle, VistaConstants.LVM_SETEXTENDEDLISTVIEWSTYLE, VistaConstants.LVS_EX_DOUBLEBUFFER, VistaConstants.LVS_EX_DOUBLEBUFFER);
                }
                catch { }

                cargarRoles();
                //cargarBaseDatos();

                DataSet ds2 = Program.oPersistencia.ejecutarSQLListas("Select id_emp, nombre from Empleados", "Empleados");

                this.CmbEmpleados.DataSource = ds2.Tables["Empleados"];
                this.CmbEmpleados.DisplayMember = ds2.Tables["Empleados"].Columns[1].ToString();
                this.CmbEmpleados.ValueMember = ds2.Tables["Empleados"].Columns[0].ToString();

                this.CmbEmpleados2.DataSource = ds2.Tables["Empleados"];
                this.CmbEmpleados2.DisplayMember = ds2.Tables["Empleados"].Columns[1].ToString();
                this.CmbEmpleados2.ValueMember = ds2.Tables["Empleados"].Columns[0].ToString();

                ds2.Dispose();

                LlenarCombos();

                this.BtnEliminar.Region = Shape.RoundedRegion(BtnEliminar.Size, 2, Shape.Corner.None);
                this.BtnUsuarioEmpleado.Region = Shape.RoundedRegion(BtnUsuarioEmpleado.Size, 2, Shape.Corner.None);
                this.button3.Region = Shape.RoundedRegion(button3.Size, 2, Shape.Corner.None);
                this.button1.Region = Shape.RoundedRegion(button1.Size, 2, Shape.Corner.None);
                this.BtnCrearLogin1.Region = Shape.RoundedRegion(BtnCrearLogin1.Size, 2, Shape.Corner.None);
                this.BtnCrearRol1.Region = Shape.RoundedRegion(BtnCrearRol1.Size, 2, Shape.Corner.None);
                this.BtnAsignarUsuario.Region = Shape.RoundedRegion(BtnAsignarUsuario.Size, 2, Shape.Corner.None);
                this.BtnCerrarListaUsuarios.Region = Shape.RoundedRegion(BtnCerrarListaUsuarios.Size, 2, Shape.Corner.None);
                this.BtnCerrarListaRolesUsuario.Region = Shape.RoundedRegion(BtnCerrarListaRolesUsuario.Size, 2, Shape.Corner.None);
                this.button2.Region = Shape.RoundedRegion(button2.Size, 2, Shape.Corner.None);

                //if (cmbLogin.Items.Count > 0)
                //    button2.Enabled = false;//Botón para ver roles por usuario
                cmbBaseDatos.SelectedIndex = 0;
            }
            else
            {
                if (MessageBox.Show(this, "No puede continuar hasta haber ingresado los empleados que utilizarán el sistema. ¿Desea realizar estas acciones en este momento?", "Atención", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                {
                    this.Close();
                    this.Dispose();

                    FrmMantEmpleados oFrmMantEmpleados = new FrmMantEmpleados();
                    oFrmMantEmpleados.ShowDialog(); 
                }
                else
                {
                    this.Close();
                    this.Dispose();
                }
            }
        }