예제 #1
0
        private void frmPerfiles_Load(object sender, EventArgs e)
        {
            /// _tipoOperacion CONSULTA = 1, EDICION = 2
            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                cnx = new MySqlConnection();
                cnx.ConnectionString = cdn;
                cmd            = new MySqlCommand();
                cmd.Connection = cnx;
                ph             = new Perfil.Core.PerfilesHelper();
                ph.Command     = cmd;

                Perfil.Core.Perfiles p = new Perfil.Core.Perfiles();
                p.idperfil = _idperfil;
                List <Perfil.Core.Perfiles> lstPerfil;

                Autorizaciones.Core.Autorizacion auth = new Autorizaciones.Core.Autorizacion();
                auth.idperfil = _idperfil;
                List <Autorizaciones.Core.Autorizacion> lstAutorizacion;

                try
                {
                    cnx.Open();
                    lstPerfil = ph.obtenerPerfile(p);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstPerfil.Count; i++)
                    {
                        txtNombre.Text = lstPerfil[i].nombre;
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta Perfil";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                }
                else
                {
                    toolTitulo.Text = "Edición Perfil";
                }
            }
        }
예제 #2
0
        private void frmDepartamentos_Load(object sender, EventArgs e)
        {
            /// _tipoOperacion CONSULTA = 1, EDICION = 2
            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                cnx = new MySqlConnection();
                cnx.ConnectionString = cdn;
                cmd            = new MySqlCommand();
                cmd.Connection = cnx;
                dh             = new Departamento.Core.DeptoHelper();
                dh.Command     = cmd;

                Departamento.Core.Depto d = new Departamento.Core.Depto();
                d.id = _iddepartamento;

                List <Departamento.Core.Depto> lstDepto;

                try
                {
                    cnx.Open();
                    lstDepto = dh.obtenerDepartamento(d);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstDepto.Count; i++)
                    {
                        txtDescripcion.Text = lstDepto[i].descripcion;
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta Departamento";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                }
                else
                {
                    toolTitulo.Text = "Edición Departamento";
                }
            }
        }
예제 #3
0
        private void frmSalario_Load(object sender, EventArgs e)
        {
            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                cnx = new MySqlConnection();
                cnx.ConnectionString = cdn;
                cmd            = new MySqlCommand();
                cmd.Connection = cnx;
                sh             = new Salario.Core.SalariosHelper();
                sh.Command     = cmd;

                Salario.Core.Salarios salario = new Salario.Core.Salarios();
                salario.idsalario = _idsalario;

                List <Salario.Core.Salarios> lstSalario;

                try
                {
                    cnx.Open();
                    lstSalario = sh.obtenerSalario(salario);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstSalario.Count; i++)
                    {
                        dtpPeriodo.Value = lstSalario[i].periodo;
                        txtValor.Text    = lstSalario[i].valor.ToString();
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta salario mínimo";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                }
                else
                {
                    toolTitulo.Text = "Edición salario mínimo";
                }
            }
        }
예제 #4
0
        private void frmFactores_Load(object sender, EventArgs e)
        {
            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                cnx = new MySqlConnection();
                cnx.ConnectionString = cdn;
                cmd            = new MySqlCommand();
                cmd.Connection = cnx;
                fh             = new Factores.Core.FactoresHelper();
                fh.Command     = cmd;

                Factores.Core.Factores factor = new Factores.Core.Factores();
                factor.idfactor = _idfactor;

                List <Factores.Core.Factores> lstFactor;

                try
                {
                    cnx.Open();
                    lstFactor = fh.obtenerFactor(factor);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstFactor.Count; i++)
                    {
                        txtAnio.Text  = lstFactor[i].anio.ToString();
                        txtValor.Text = lstFactor[i].valor.ToString();
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta factor de integración";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                }
                else
                {
                    toolTitulo.Text = "Edición factor de integración";
                }
            }
        }
예제 #5
0
        private void frmEmpresas_Load(object sender, EventArgs e)
        {
            /// _tipoOperacion CONSULTA = 1, EDICION = 2
            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                cnx = new MySqlConnection();
                cnx.ConnectionString = cdn;
                cmd            = new MySqlCommand();
                cmd.Connection = cnx;
                eh             = new Empresas.Core.EmpresasHelper();
                eh.Command     = cmd;

                dh         = new Direccion.Core.DireccionesHelper();
                dh.Command = cmd;

                Direccion.Core.Direcciones d = new Direccion.Core.Direcciones();
                d.idpersona   = _idempresa;
                d.tipopersona = 0; ///TIPO PERSONA 0 - Empresas
                List <Empresas.Core.Empresas>     lstEmpresa;
                List <Direccion.Core.Direcciones> lstDireccion;

                try
                {
                    cnx.Open();
                    lstEmpresa   = eh.obtenerEmpresa(_idempresa);
                    lstDireccion = dh.obtenerDireccion(d);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstEmpresa.Count; i++)
                    {
                        txtNombre.Text            = lstEmpresa[i].nombre;
                        txtRepresentante.Text     = lstEmpresa[i].representante;
                        txtRfc.Text               = lstEmpresa[i].rfc;
                        txtRegistroPatronal.Text  = lstEmpresa[i].registro;
                        txtDigitoVerificador.Text = lstEmpresa[i].digitoverificador.ToString();
                        chkEsSindicato.Checked    = Convert.ToBoolean(lstEmpresa[i].sindicato);
                    }

                    for (int i = 0; i < lstDireccion.Count; i++)
                    {
                        _iddireccion      = lstDireccion[i].iddireccion;
                        txtCalle.Text     = lstDireccion[i].calle;
                        txtExterior.Text  = lstDireccion[i].exterior;
                        txtInterior.Text  = lstDireccion[i].interior;
                        txtColonia.Text   = lstDireccion[i].colonia;
                        txtCP.Text        = lstDireccion[i].cp;
                        txtMunicipio.Text = lstDireccion[i].ciudad;
                        txtEstado.Text    = lstDireccion[i].estado;
                        txtPais.Text      = lstDireccion[i].pais;
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta Empresa";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                    GLOBALES.INHABILITAR(this, typeof(MaskedTextBox));
                    GLOBALES.INHABILITAR(this, typeof(CheckBox));
                }
                else
                {
                    toolTitulo.Text = "Edición Empresa";
                }
            }
        }
예제 #6
0
        private void frmComplementos_Load(object sender, EventArgs e)
        {
            CargaComboBox();
            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                cnx = new MySqlConnection();
                cnx.ConnectionString = cdn;
                cmd            = new MySqlCommand();
                cmd.Connection = cnx;
                ch             = new Complementos.Core.ComplementoHelper();
                dh             = new Direccion.Core.DireccionesHelper();
                ch.Command     = cmd;
                dh.Command     = cmd;

                List <Complementos.Core.Complemento> lstComplemento;
                List <Direccion.Core.Direcciones>    lstDireccion;

                Complementos.Core.Complemento c = new Complementos.Core.Complemento();
                c.idtrabajador = _idEmpleado;

                Direccion.Core.Direcciones d = new Direccion.Core.Direcciones();
                d.idpersona   = _idEmpleado;
                d.tipopersona = 2;

                try
                {
                    cnx.Open();
                    lstComplemento = ch.obtenerComplemento(c);
                    lstDireccion   = dh.obtenerDireccion(d);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstComplemento.Count; i++)
                    {
                        idComplemento                 = lstComplemento[i].id;
                        cmbContrato.SelectedValue     = lstComplemento[i].contrato;
                        cmbJornada.SelectedValue      = lstComplemento[i].jornada;
                        cmbDepartamento.SelectedValue = lstComplemento[i].iddepartamento;
                        cmbPuesto.SelectedValue       = lstComplemento[i].idpuesto;
                        cmbEstadoCivil.SelectedValue  = lstComplemento[i].estadocivil;
                        cmbSexo.SelectedValue         = lstComplemento[i].sexo;
                        cmbEscolaridad.SelectedValue  = lstComplemento[i].escolaridad;
                        txtHorario.Text               = lstComplemento[i].horario;
                        txtNoControl.Text             = lstComplemento[i].nocontrol;
                        txtClinica.Text               = lstComplemento[i].clinica;
                        txtNacionalidad.Text          = lstComplemento[i].nacionalidad;
                        txtFunciones.Text             = lstComplemento[i].funciones;
                    }

                    for (int j = 0; j < lstDireccion.Count; j++)
                    {
                        idDireccion       = lstDireccion[j].iddireccion;
                        txtCalle.Text     = lstDireccion[j].calle;
                        txtExterior.Text  = lstDireccion[j].exterior;
                        txtInterior.Text  = lstDireccion[j].interior;
                        txtColonia.Text   = lstDireccion[j].colonia;
                        txtCP.Text        = lstDireccion[j].cp;
                        txtMunicipio.Text = lstDireccion[j].ciudad;
                        txtEstado.Text    = lstDireccion[j].estado;
                        txtPais.Text      = lstDireccion[j].pais;
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta del Complemento";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                    GLOBALES.INHABILITAR(this, typeof(MaskedTextBox));
                    GLOBALES.INHABILITAR(this, typeof(ComboBox));
                }
                else
                {
                    toolTitulo.Text = "Edición del Complemento";
                }
            }
        }
예제 #7
0
        private void frmEmpleados_Load(object sender, EventArgs e)
        {
            CargaComboBox();
            /// _tipoOperacion CONSULTA = 1, EDICION = 2
            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                cnx = new MySqlConnection();
                cnx.ConnectionString = cdn;
                cmd            = new MySqlCommand();
                cmd.Connection = cnx;
                eh             = new Empleados.Core.EmpleadosHelper();
                eh.Command     = cmd;

                List <Empleados.Core.Empleados> lstEmpleado;

                Empleados.Core.Empleados em = new Empleados.Core.Empleados();
                em.idtrabajador = _idempleado;

                try
                {
                    cnx.Open();
                    lstEmpleado = eh.obtenerEmpleado(em);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstEmpleado.Count; i++)
                    {
                        txtNombre.Text                = lstEmpleado[i].nombres;
                        txtApPaterno.Text             = lstEmpleado[i].paterno;
                        txtApMaterno.Text             = lstEmpleado[i].materno;
                        dtpFechaNacimiento.Value      = DateTime.Parse(lstEmpleado[i].fechanacimiento.ToString());
                        txtEdad.Text                  = lstEmpleado[i].edad.ToString();
                        dtpFechaIngreso.Value         = lstEmpleado[i].fechaingreso;
                        cmbLocalForaneo.SelectedValue = lstEmpleado[i].localforaneo;
                        cmbSua.SelectedValue          = lstEmpleado[i].sua;
                        txtRFC.Text    = lstEmpleado[i].rfc;
                        txtCURP.Text   = lstEmpleado[i].curp;
                        txtNSS.Text    = lstEmpleado[i].nss;
                        txtDigito.Text = lstEmpleado[i].digitoverificador.ToString();

                        lblCliente.Visible = false;
                        lblPeriodo.Visible = false;
                        cmbCliente.Visible = false;
                        cmbPeriodo.Visible = false;

                        lblSalario.Visible     = false;
                        lblTipoSalario.Visible = false;
                        lblSueldo.Visible      = false;
                        lblSD.Visible          = false;
                        lblSDI.Visible         = false;
                        cmbTipoSalario.Visible = false;
                        txtSueldo.Visible      = false;
                        txtSD.Visible          = false;
                        txtSDI.Visible         = false;
                        btnCalcular.Visible    = false;
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta Empleado";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                    GLOBALES.INHABILITAR(this, typeof(MaskedTextBox));
                    GLOBALES.INHABILITAR(this, typeof(Button));
                    GLOBALES.INHABILITAR(this, typeof(DateTimePicker));
                    GLOBALES.INHABILITAR(this, typeof(ComboBox));
                }
                else
                {
                    toolTitulo.Text = "Edición Empleado";
                }
            }
        }
예제 #8
0
        private void frmClientes_Load(object sender, EventArgs e)
        {
            /// _tipoOperacion CONSULTA = 1, EDICION = 2
            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                cnx = new MySqlConnection();
                cnx.ConnectionString = cdn;
                cmd            = new MySqlCommand();
                cmd.Connection = cnx;
                ch             = new Clientes.Core.ClientesHelper();
                ch.Command     = cmd;

                dh         = new Direccion.Core.DireccionesHelper();
                dh.Command = cmd;

                Clientes.Core.Clientes cli = new Clientes.Core.Clientes();
                cli.idcliente = _idcliente;

                Direccion.Core.Direcciones d = new Direccion.Core.Direcciones();
                d.idpersona   = _idcliente;
                d.tipopersona = 1; ///TIPO PERSONA 1 - Clientes
                List <Clientes.Core.Clientes>     lstCliente;
                List <Direccion.Core.Direcciones> lstDireccion;

                try
                {
                    cnx.Open();
                    lstCliente   = ch.obtenerCliente(cli);
                    lstDireccion = dh.obtenerDireccion(d);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstCliente.Count; i++)
                    {
                        txtNombre.Text = lstCliente[i].nombre;
                        txtRfc.Text    = lstCliente[i].rfc;
                    }

                    for (int i = 0; i < lstDireccion.Count; i++)
                    {
                        _iddireccion      = lstDireccion[i].iddireccion;
                        txtCalle.Text     = lstDireccion[i].calle;
                        txtExterior.Text  = lstDireccion[i].exterior;
                        txtInterior.Text  = lstDireccion[i].interior;
                        txtColonia.Text   = lstDireccion[i].colonia;
                        txtCP.Text        = lstDireccion[i].cp;
                        txtMunicipio.Text = lstDireccion[i].ciudad;
                        txtEstado.Text    = lstDireccion[i].estado;
                        txtPais.Text      = lstDireccion[i].pais;
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta Cliente";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                    GLOBALES.INHABILITAR(this, typeof(MaskedTextBox));
                }
                else
                {
                    toolTitulo.Text = "Edición Cliente";
                }
            }
        }
예제 #9
0
        private void frmPeriodos_Load(object sender, EventArgs e)
        {
            cnx = new MySqlConnection();
            cnx.ConnectionString = cdn;
            cmd            = new MySqlCommand();
            cmd.Connection = cnx;
            Clientes.Core.ClientesHelper ch = new Clientes.Core.ClientesHelper();
            ch.Command = cmd;

            //DataTable dtClientes = new DataTable();
            List <Clientes.Core.Clientes> lstClientes = new List <Clientes.Core.Clientes>();

            Clientes.Core.Clientes cliente = new Clientes.Core.Clientes();
            cliente.plaza = GLOBALES.IDPLAZA;

            try
            {
                cnx.Open();
                lstClientes = ch.obtenerClientes(cliente);
                //dtClientes = ch.dtObtenerClientes(cliente);
                cnx.Close();
                cnx.Dispose();
            }
            catch (Exception error)
            {
                MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
            }

            cmbCliente.DataSource    = lstClientes.ToList();
            cmbCliente.ValueMember   = "idcliente";
            cmbCliente.DisplayMember = "nombre";

            if (_tipoOperacion == GLOBALES.CONSULTAR || _tipoOperacion == GLOBALES.MODIFICAR)
            {
                ph         = new Periodos.Core.PeriodosHelper();
                ph.Command = cmd;

                Periodos.Core.Periodos p = new Periodos.Core.Periodos();
                p.idperiodo = _idperiodo;

                List <Periodos.Core.Periodos> lstPeriodo;

                try
                {
                    cnx.Open();
                    lstPeriodo = ph.obtenerPeriodo(p);
                    cnx.Close();
                    cnx.Dispose();

                    for (int i = 0; i < lstPeriodo.Count; i++)
                    {
                        cmbCliente.SelectedValue   = lstPeriodo[i].idperiodo;
                        cmbPago.SelectedText       = lstPeriodo[i].pago;
                        txtDias.Text               = lstPeriodo[i].dias.ToString();
                        cmbDiaInicio.SelectedText  = lstPeriodo[i].inicio;
                        cmbDiaTermino.SelectedText = lstPeriodo[i].termino;
                    }
                }
                catch (Exception error)
                {
                    MessageBox.Show("Error: \r\n \r\n " + error.Message, "Error");
                }

                if (_tipoOperacion == GLOBALES.CONSULTAR)
                {
                    toolTitulo.Text = "Consulta Periodo";
                    GLOBALES.INHABILITAR(this, typeof(TextBox));
                    GLOBALES.INHABILITAR(this, typeof(ComboBox));
                }
                else
                {
                    toolTitulo.Text = "Edición Periodo";
                }
            }

            cmbPago.SelectedIndex       = 0;
            cmbDiaInicio.SelectedIndex  = 0;
            cmbDiaTermino.SelectedIndex = 6;
        }