Пример #1
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            CLS_Empleados selE = new CLS_Empleados();

            selE.SSN      = txtSSN.Text;
            selE.Name     = txtNombre.Text;
            selE.lastname = txtApellido.Text;
            selE.TITLE    = txtPuesto.Text;
            selE.MtdSeleccionarEmpleados();
            if (selE.Exito)
            {
                if (selE.Datos.Rows.Count > 0)
                {
                    dtgEmpleados.DataSource = selE.Datos;
                }
                else
                {
                    dtgEmpleados.DataSource = selE.Datos;
                    XtraMessageBox.Show("No se encontraron Empleados con estos parametros de busqueda");
                }
            }
            else
            {
                XtraMessageBox.Show(selE.Mensaje);
            }
        }
Пример #2
0
        public void CargarEmpleado(string Valor)
        {
            CLS_Empleados CBEmpleados = new CLS_Empleados();

            CBEmpleados.Activo = "1";
            CBEmpleados.MtdSeleccionarEmpleadosHis();
            if (CBEmpleados.Exito)
            {
                cmbEmpleado.Properties.DisplayMember = "Nombre_Empleado";
                cmbEmpleado.Properties.ValueMember   = "Id_Empleado";
                cmbEmpleado.EditValue             = Valor;
                cmbEmpleado.Properties.DataSource = CBEmpleados.Datos;
            }
        }
Пример #3
0
        private void EliminarEmpleados()
        {
            CLS_Empleados Clase = new CLS_Empleados();

            Clase.Id_Empleado = textId.Text.Trim();

            Clase.MtdEliminarEmpleados();
            if (Clase.Exito)
            {
                CargarEmpleados();
                XtraMessageBox.Show("Se ha Eliminado el registro con exito");
                LimpiarCampos();
            }
            else
            {
                XtraMessageBox.Show(Clase.Mensaje);
            }
        }
Пример #4
0
        private void CargarEmpleados()
        {
            gridControl1.DataSource = null;
            CLS_Empleados Clase = new CLS_Empleados();

            if (checkActivo.Checked)
            {
                Clase.Activo = "0";
            }
            else
            {
                Clase.Activo = "1";
            }

            Clase.MtdSeleccionarEmpleados();
            if (Clase.Exito)
            {
                gridControl1.DataSource = Clase.Datos;
            }
        }
Пример #5
0
        private void InsertarEmpleados()
        {
            CLS_Empleados Clase = new CLS_Empleados();

            Clase.Id_Empleado     = textId.Text.Trim();
            Clase.Nombre_Empleado = textEmpleado.Text.Trim();
            if (dateNacimiento.EditValue != null)
            {
                Clase.Fecha_Nacimiento = dateNacimiento.DateTime.Year.ToString() + DosCero(dateNacimiento.DateTime.Month.ToString()) + DosCero(dateNacimiento.DateTime.Day.ToString());
            }
            else
            {
                Clase.Fecha_Nacimiento = string.Empty;
            }
            Clase.NSS = textNSS.Text.Trim();
            if (dateAltaSegSocial.EditValue != null)
            {
                Clase.Fecha_Alta_Seg_Social = dateAltaSegSocial.DateTime.Year.ToString() + DosCero(dateAltaSegSocial.DateTime.Month.ToString()) + DosCero(dateAltaSegSocial.DateTime.Day.ToString());
            }
            else
            {
                Clase.Fecha_Alta_Seg_Social = string.Empty;
            }
            if (dateBajaSegSocial.EditValue != null)
            {
                Clase.Fecha_Baja_Seg_Social = dateBajaSegSocial.DateTime.Year.ToString() + DosCero(dateBajaSegSocial.DateTime.Month.ToString()) + DosCero(dateBajaSegSocial.DateTime.Day.ToString());
            }
            else
            {
                Clase.Fecha_Baja_Seg_Social = string.Empty;
            }
            Clase.Cuenta  = textCuenta.Text.Trim();
            Clase.Tarjeta = textNoTarjeta.Text.Trim();
            if (dateAltaSegVida.EditValue != null)
            {
                Clase.Fecha_Alta_Seg_Vida = dateAltaSegVida.DateTime.Year.ToString() + DosCero(dateAltaSegVida.DateTime.Month.ToString()) + DosCero(dateAltaSegVida.DateTime.Day.ToString());
            }
            else
            {
                Clase.Fecha_Alta_Seg_Vida = string.Empty;
            }
            if (dateBajaSegVida.EditValue != null)
            {
                Clase.Fecha_Baja_Seg_Vida = dateBajaSegVida.DateTime.Year.ToString() + DosCero(dateBajaSegVida.DateTime.Month.ToString()) + DosCero(dateBajaSegVida.DateTime.Day.ToString());
            }
            else
            {
                Clase.Fecha_Baja_Seg_Vida = string.Empty;
            }
            Clase.Id_Puesto = glePuesto.EditValue.ToString();
            if (gleCuadrilla.EditValue != null)
            {
                Clase.Id_Cuadrilla = gleCuadrilla.EditValue.ToString();
            }
            else
            {
                Clase.Id_Cuadrilla = string.Empty;
            }
            Clase.Activo  = "1";
            Clase.Usuario = UsuariosLogin.Trim();
            Clase.MtdInsertarEmpleados();
            if (Clase.Exito)
            {
                CargarEmpleados();
                XtraMessageBox.Show("Se ha Insertado el registro con exito");
                LimpiarCampos();
            }
            else
            {
                XtraMessageBox.Show(Clase.Mensaje);
            }
        }