예제 #1
0
        public bool Actualizar(decimal idEmpleado, DateTime fechaRetiro, string notas, string estado, string carpeta)
        {
            Conexion conexion = new Conexion(Empresa);
            String sql = null;
            bool actualizado = true;

            sql = "usp_contratacion_retiros_actualizar_v2 " + idEmpleado;

            if (!string.IsNullOrEmpty(notas)) sql += ", '" + notas + "'";
            else sql += ", Null";

            if (!string.IsNullOrEmpty(estado)) sql += ", '" + estado + "'";
            else sql += ", Null";

            if (!string.IsNullOrEmpty(carpeta)) sql += ", '" + carpeta + "'";
            else sql += ", Null";

            if (new DateTime() != fechaRetiro) sql += ", '" + fechaRetiro.ToShortDateString() + "'";
            else sql += ",null";

            sql += ", '" + Usuario + "'";

            try
            {
                conexion.ExecuteNonQuery(sql);
            }
            catch (Exception e)
            {
                actualizado = false;
                throw new Exception("Error al consultar información del retiro. " + e.Message);
            }
            finally
            {
                conexion.Desconectar();
            }
            return actualizado;
        }
예제 #2
0
        public Boolean ActualizarFechaAvisoNenRContratos(Decimal REGISTRO,
            Conexion conexion)
        {
            Int32 cantidadRegistrosActualizados = 0;
            String sql = null;
            Boolean ejecutar = true;

            tools _tools = new tools();

            sql = "usp_ven_r_contratos_actualizar_fecha_aviso ";

            if (REGISTRO != 0)
            {
                sql += REGISTRO + ", ";
            }
            else
            {
                MensajeError = "El campo REGISTRO no puede ser 0\n";
                ejecutar = false;
            }

            if (ejecutar)
            {
                try
                {
                    cantidadRegistrosActualizados = conexion.ExecuteNonQuery(sql);
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
            }

            if (cantidadRegistrosActualizados > 0) return true;
            else return false;
        }
        public Boolean EliminarRegistroAlmRegProductoProveedor(Decimal REGISTRO, Conexion conexion)
        {
            int cantidadRegistrosActualizados = 0;
            String sql = null;
            Boolean ejecutar = true;

            sql = "usp_alm_reg_productos_proveedor_eliminar_por_registro ";

            if (REGISTRO != 0)
            {
                sql += REGISTRO;
            }
            else
            {
                MensajeError += "El campo REGISTRO no puede ser nulo\n";
                ejecutar = false;
            }

            if (ejecutar)
            {
                try
                {
                    cantidadRegistrosActualizados = conexion.ExecuteNonQuery(sql);
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    cantidadRegistrosActualizados = 0;
                }
            }

            if (cantidadRegistrosActualizados <= 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
예제 #4
0
        public Boolean Adicionar(List<Permiso> permisos)
        {
            String sql = null;
            Boolean ejecutado = true;

            Conexion conexion = new Conexion(Empresa);
            conexion.IniciarTransaccion();

            foreach (Permiso permiso in permisos)
            {
                sql = "usp_oper_permisos_adicionar ";
                sql += "'" + permiso.Proceso.ToString() + "', ";
                sql += "'" + permiso.ProcesoPermitido.ToString() + "', ";
                sql += "'" + permiso.Seccion.ToString() + "'";

                try
                {
                    conexion.ExecuteNonQuery(sql);
                }
                catch (ApplicationException e)
                {
                    ejecutado = false;
                    throw new Exception(e.Message);
                }
            }

            if (ejecutado)
            {
                conexion.AceptarTransaccion();
            }
            else
            {
                conexion.DeshacerTransaccion();
                conexion.Desconectar();
            }
            return ejecutado;
        }
        public Boolean ActualizarConRegContratosAuditoria(Decimal REGISTRO,
            String TIPO_CONTRATO,
            String PAGO_DIAS_PRODUCTIVIDAD,
            Decimal VALOR_NOMINA,
            Decimal VALOR_CONTRATO,
            DateTime FECHA_INICIO_PERIODO,
            DateTime FECHA_FIN_PERIODO,
            String PERIODO_PAGO,
            String CLASE_CONTRATO,
            String CONTROL_CONTRATO,
            Conexion conexion)
        {
            Int32 cantidadRegistrosActualizados = 0;
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;

            tools _tools = new tools();

            sql = "usp_con_reg_contratos_actualizar_auditoria_v3 ";

            #region validaciones
            if (REGISTRO != 0)
            {
                sql += REGISTRO + ", ";
                informacion += "REGISTRO = '" + REGISTRO.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo REGISTRO no puede ser nulo\n";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(TIPO_CONTRATO) == false)
            {
                sql += "'" + TIPO_CONTRATO + "', ";
                informacion += "TIPO_CONTRATO = '" + TIPO_CONTRATO + "', ";
            }
            else
            {
                MensajeError += "El campo TIPO_CONTRATO no puede ser nulo\n";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(PAGO_DIAS_PRODUCTIVIDAD) == false)
            {
                sql += "'" + PAGO_DIAS_PRODUCTIVIDAD + "', ";
                informacion += "PAGO_DIAS_PRODUCTIVIDAD = '" + PAGO_DIAS_PRODUCTIVIDAD + "', ";
            }
            else
            {
                MensajeError += "El campo PAGO_DIAS_PRODUCTIVIDAD no puede ser nulo\n";
                ejecutar = false;
            }

            if (VALOR_NOMINA != 0)
            {
                sql += _tools.convierteComaEnPuntoParaDecimalesEnSQL(VALOR_NOMINA) + ", ";
                informacion += "VALOR_NOMINA = '" + _tools.convierteComaEnPuntoParaDecimalesEnSQL(VALOR_NOMINA) + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "VALOR_NOMINA = 'NULL', ";
            }

            if (VALOR_CONTRATO != 0)
            {
                sql += _tools.convierteComaEnPuntoParaDecimalesEnSQL(VALOR_CONTRATO) + ", ";
                informacion += "VALOR_CONTRATO = '" + _tools.convierteComaEnPuntoParaDecimalesEnSQL(VALOR_CONTRATO) + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "VALOR_CONTRATO = 'NULL', ";
            }

            if (!string.IsNullOrEmpty(FECHA_INICIO_PERIODO.ToString()))
            {
                sql += "'" + _tools.obtenerStringConFormatoFechaSQLServer(FECHA_INICIO_PERIODO) + "', ";
                informacion += "FECHA_INICIO_PERIODO = '" + FECHA_INICIO_PERIODO.ToString() + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "FECHA_INICIO_PERIODO = 'NULL', ";
            }

            if (!string.IsNullOrEmpty(FECHA_FIN_PERIODO.ToString()))
            {
                sql += "'" + _tools.obtenerStringConFormatoFechaSQLServer(FECHA_FIN_PERIODO) + "', ";
                informacion += "FECHA_FIN_PERIODO = '" + FECHA_FIN_PERIODO.ToString() + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "FECHA_FIN_PERIODO = 'NULL', ";
            }

            sql += "'" + Usuario + "', ";
            informacion += "USU_MOD = '" + Usuario.ToString() + "', ";

            if (String.IsNullOrEmpty(PERIODO_PAGO) == false)
            {
                sql += "'" + PERIODO_PAGO + "', ";
                informacion += "PERIODO_PAGO = '" + PERIODO_PAGO.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo PERIODO_PAGO no puede ser nulo\n";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(CLASE_CONTRATO) == false)
            {
                sql += "'" + CLASE_CONTRATO + "', ";
                informacion += "CLASE_CONTRATO = '" + CLASE_CONTRATO + "', ";
            }
            else
            {
                MensajeError += "El campo CLASE_CONTRATO no puede ser nulo\n";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(CONTROL_CONTRATO) == false)
            {
                sql += "'" + CONTROL_CONTRATO + "'";
                informacion += "CONTROL_CONTRATO = '" + CONTROL_CONTRATO + "'";
            }
            else
            {
                MensajeError += "El campo CONTROL_CONTRATO no puede ser nulo\n";
                ejecutar = false;
            }

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    cantidadRegistrosActualizados = conexion.ExecuteNonQuery(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.CON_REG_CONTRATOS, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
            }

            if (cantidadRegistrosActualizados > 0) return true;
            else return false;
        }
        public Boolean ActualizarConRegContratosImpresos(int REGISTRO, String CONTRATO_IMPRESO, String CLAUSULAS_IMPRESO)
        {
            Int32 cantidadRegistrosActualizados = 0;
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;

            tools _tools = new tools();

            sql = "usp_con_reg_contratos_actualizar_impresion ";

            #region validaciones
            if (REGISTRO != 0)
            {
                sql += REGISTRO + ", ";
                informacion += "REGISTRO = '" + REGISTRO.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo REGISTRO no puede ser nulo\n";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(CONTRATO_IMPRESO) == false)
            {
                sql += "'" + CONTRATO_IMPRESO + "', ";
                informacion += "CONTRATO_IMPRESO = '" + CONTRATO_IMPRESO + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "CONTRATO_IMPRESO = NULL, ";
            }

            if (String.IsNullOrEmpty(CLAUSULAS_IMPRESO) == false)
            {
                sql += "'" + CLAUSULAS_IMPRESO + "' ";
                informacion += "CLAUSULAS_IMPRESO = '" + CLAUSULAS_IMPRESO + "' ";
            }
            else
            {
                sql += "NULL ";
                informacion += "CLAUSULAS_IMPRESO = NULL ";
            }

            #endregion validaciones

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    cantidadRegistrosActualizados = conexion.ExecuteNonQuery(sql);
                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.CON_REG_CONTRATOS, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            if (cantidadRegistrosActualizados > 0) return true;
            else return false;
        }
예제 #7
0
        public Decimal EliminarNovedadPorOrigen(Decimal ID_PERIODO, String ORIGEN, Decimal ID_EMPRESA, String PERIODOSPROCESO, String TIPOPERIODO)
        {
            String sql = null;
            Decimal rowsDeleted = 0;
            String informacion = null;
            Boolean ejecutar = true;

            sql = "usp_nom_nomina_novedades_eliminar_por_origen ";

            #region validaciones
            sql += "'" + ID_PERIODO.ToString() + "', ";
            informacion += "ID_PERIODO= '" + ID_PERIODO.ToString() + ", ";

            if (!(String.IsNullOrEmpty(ORIGEN)))
            {
                sql += "'" + ORIGEN + "', ";
                informacion += "ORIGEN = '" + ORIGEN.ToString() + "'";
            }
            else
            {
                MensajeError += "El campo ORIGEN es requerido para la eliminacion.";
                ejecutar = false;
            }

            sql += "'" + ID_EMPRESA.ToString() + "', ";
            informacion += "ID_EMPRESA= '" + ID_EMPRESA.ToString() + ", ";
            sql += "'" + PERIODOSPROCESO.ToString() + "', ";
            sql += "'" + TIPOPERIODO + "'";
            informacion += "PERIODOSPROCESO= '" + PERIODOSPROCESO.ToString() + ", ";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";

            #endregion

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    rowsDeleted = conexion.ExecuteNonQuery(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.NOM_NOMINA_NOVEDADES, tabla.ACCION_ELIMINAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            return rowsDeleted;
        }
예제 #8
0
        public Decimal Adicionar(Decimal ID_EMPLEADO, Int32 ID_CONCEPTO, Int32 ID_PERIODO, Decimal CANTIDAD, Decimal VALOR, String ORIGEN, String ESTADO, Conexion conexion)
        {
            String sql = null;
            String idRecuperado = null;
            String informacion = null;
            Boolean ejecutar = true;
            tools _tools = new tools();

            sql = "usp_nom_nomina_novedades_adicionar ";

            #region validaciones
            if (ID_EMPLEADO != 0)
            {
                sql += "'" + ID_EMPLEADO.ToString() + "', ";
                informacion += "ID_EMPLEADO= '" + ID_EMPLEADO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo ID_EMPLEADO es requerido para la consulta.";
                ejecutar = false;
            }
            if (ID_CONCEPTO != 0)
            {
                sql += "'" + ID_CONCEPTO.ToString() + "', ";
                informacion += "ID_CONCEPTO= '" + ID_CONCEPTO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo ID_CONCEPTO es requerido para la consulta.";
                ejecutar = false;
            }
            if (ID_PERIODO != 0)
            {
                sql += "'" + ID_PERIODO.ToString() + "', ";
                informacion += "ID_PERIODO= '" + ID_PERIODO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo ID_PERIODO es requerido para la consulta.";
                ejecutar = false;
            }

            sql += "'" + CANTIDAD.ToString() + "', ";
            informacion += "CANTIDAD= '" + CANTIDAD.ToString() + ", ";

            sql += "'" + VALOR.ToString() + "', ";
            informacion += "VALOR= '" + VALOR.ToString() + ", ";

            if (!(String.IsNullOrEmpty(ORIGEN)))
            {
                sql += "'" + ORIGEN + "', ";
                informacion += "ORIGEN = '" + ORIGEN.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo ORIGEN no puede ser nulo\n";
                ejecutar = false;
            }
            if (!(String.IsNullOrEmpty(ESTADO)))
            {
                sql += "'" + ESTADO + "', ";
                informacion += "ESTADO = '" + ESTADO.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo ESTADO no puede ser nulo\n";
                ejecutar = false;
            }

            sql += "'" + Usuario + "' ";
            informacion += "USU_CRE = '" + Usuario.ToString() + "'";
            #endregion

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.NOM_NOMINA_NOVEDADES, tabla.ACCION_ADICIONAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
            }

            if (!(String.IsNullOrEmpty(idRecuperado))) return Convert.ToDecimal(idRecuperado);
            else return 0;
        }
        public Boolean ActualizarMotivo(Decimal id_motivo,
            String motivo,
            Boolean activo,
            Conexion conexion)
        {
            String sql = null;
            Boolean ejecutar = true;
            int numRegistrosAfectados = 0;

            String informacion = String.Empty;

            sql = "usp_prog_motivos_cancelacion_reprogrmacion_actualizar ";
            informacion = sql;

            #region validaciones
            if (id_motivo != 0)
            {
                sql += id_motivo + ", ";
                informacion += "ID_MOTIVO = '" + id_motivo + "', ";
            }
            else
            {
                MensajeError += "El campo ID_MOTIVO no puede ser nulo\n";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(motivo) == false)
            {
                sql += "'" + motivo + "', ";
                informacion += "MOTIVO = '" + motivo + "', ";
            }
            else
            {
                MensajeError += "El campo MOTIVO no puede ser nulo\n";
                ejecutar = false;
            }

            if (activo == false)
            {
                sql += "'False', ";
                informacion += "ACTIVO = 'False', ";
            }
            else
            {
                sql += "'True', ";
                informacion += "ACTIVO = 'True', ";
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario + "'";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    numRegistrosAfectados = conexion.ExecuteNonQuery(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.PROG_MOTIVOS_CANCELACION_REPROGRAMACION, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    ejecutar = false;
                }
            }

            return ejecutar;
        }
        public Boolean DesactivarRegistroConfiguracion(Decimal ID_CONFIGURACION, Conexion conexion)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            tools _tools = new tools();

            sql = "usp_alm_crt_envio_ordenes_desactivar ";

            #region validaciones

            if (ID_CONFIGURACION != 0)
            {
                sql += ID_CONFIGURACION + ", ";
                informacion += "ID_CONFIGURACION = '" + ID_CONFIGURACION + "', ";
            }
            else
            {
                MensajeError = "El campo ID_CONFIGURACION no puede ser vacio.";
                ejecutar = false;
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    if (conexion.ExecuteNonQuery(sql) <= 0)
                    {
                        MensajeError = "ERROR: Al intentar desactivar el registro de configuración de envios de ordenes de compra.";
                        ejecutadoCorrectamente = false;
                    }
                    else
                    {
                        auditoria _auditoria = new auditoria(Empresa);
                        if (!(_auditoria.Adicionar(Usuario, tabla.ALM_CRT_ENVIO_ORDENES, tabla.ACCION_ELIMINAR, sql, informacion, conexion)))
                        {
                            MensajeError = "ERROR: Al intentar ingresar la auditoría para la desactivación de la configuración de envios de ordenes de compra.";
                            ejecutadoCorrectamente = false;
                        }
                    }
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            if (ejecutadoCorrectamente)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public Boolean InhabilitarResultadoEntrevistaRetiro(Decimal ID_DETALLE_ROTACION_EMPLEADO,
            Conexion conexion)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            tools _tools = new tools();

            sql = "usp_sel_reg_detalle_rotacion_empleado_inhabilitar ";

            #region validaciones

            if (ID_DETALLE_ROTACION_EMPLEADO != 0)
            {
                sql += ID_DETALLE_ROTACION_EMPLEADO + ", ";
                informacion += "ID_DETALLE_ROTACION_EMPLEADO = '" + ID_DETALLE_ROTACION_EMPLEADO + "', ";
            }
            else
            {
                MensajeError = "El campo ID_DETALLE_ROTACION_EMPLEADO no puede ser vacio.";
                ejecutar = false;
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.SEL_REG_DETALLE_ROTACION_EMPLEADO, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            return ejecutadoCorrectamente;
        }
        public Boolean ActualizarCategoria(Decimal ID_MAESTRA_ROTACION,
            String TITULO,
            Boolean ACTIVO,
            Conexion conexion)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            tools _tools = new tools();

            sql = "usp_sel_reg_maestra_rotacion_retiros_actualizar ";

            #region validaciones

            if (ID_MAESTRA_ROTACION != 0)
            {
                sql += ID_MAESTRA_ROTACION + ", ";
                informacion += "ID_MAESTRA_ROTACION = '" + ID_MAESTRA_ROTACION + "', ";
            }
            else
            {
                MensajeError = "El campo ID_MAESTRA_ROTACION no puede ser vacio.";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(TITULO) == false)
            {
                sql += "'" + TITULO + "', ";
                informacion += "TITULO = '" + TITULO + "', ";
            }
            else
            {
                MensajeError = "El campo TITULO no puede ser vacio.";
                ejecutar = false;
            }

            if (ACTIVO == true)
            {
                sql += "'True', ";
                informacion += "ACTIVO = 'True', ";
            }
            else
            {
                sql += "'False', ";
                informacion += "ACTIVO = 'False', ";
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.SEL_REG_MAESTRA_ROTACION_RETIROS, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            return ejecutadoCorrectamente;
        }
        public Boolean InhabilitarMotivoAsociadoAEmpresa(Decimal ID_ROTACION_EMPRESA,
            Conexion conexion)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            tools _tools = new tools();

            sql = "usp_sel_reg_rotacion_rotacion_retiros_empresa_inhabilitar ";

            #region validaciones

            if (ID_ROTACION_EMPRESA != 0)
            {
                sql += ID_ROTACION_EMPRESA + ", ";
                informacion += "ID_ROTACION_EMPRESA = '" + ID_ROTACION_EMPRESA + "', ";
            }
            else
            {
                MensajeError = "El campo ID_ROTACION_EMPRESA no puede ser vacio.";
                ejecutar = false;
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.SEL_REG_MAESTRA_ROTACION_RETIROS, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            return ejecutadoCorrectamente;
        }
예제 #14
0
        public Boolean Actualizar(Decimal ID_EVALUACION,
            Decimal ID_EMPLEADO_EVALUADOR,
            DateTime FECHA_EVALUACION,
            Decimal PUNTAJE,
            String CALIFICACION,
            String FORTALEZAS,
            String OPORTUNIDAD_MEJORAS,
            String CURSOS_CAPACITACIONES)
        {
            Conexion conexion = new Conexion(Empresa);
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            tools _tools = new tools();

            sql = "usp_gh_evaluaciones_actualizar ";

            #region validaciones

            if (ID_EVALUACION != 0)
            {
                sql += ID_EVALUACION + ", ";
                informacion += "ID_EVALUACION = '" + ID_EVALUACION + "', ";
            }
            else
            {
                MensajeError = "El campo ID_EVALUACION no puede ser vacio.";
                ejecutar = false;
            }

            if (ID_EMPLEADO_EVALUADOR != 0)
            {
                sql += ID_EMPLEADO_EVALUADOR + ", ";
                informacion += "ID_EMPLEADO_EVALUADOR = '" + ID_EMPLEADO_EVALUADOR + "', ";
            }
            else
            {
                MensajeError = "El campo ID_EMPLEADO_EVALUADOR no puede ser vacio.";
                ejecutar = false;
            }

            sql += "'" + _tools.obtenerStringConFormatoFechaSQLServer(FECHA_EVALUACION) + "', ";
            informacion += "FECHA_EVALUACION = '" + FECHA_EVALUACION.ToShortDateString() + "', ";

            if (ID_EMPLEADO_EVALUADOR != 0)
            {
                sql += PUNTAJE.ToString().Replace(',', '.') + ", ";
                informacion += "PUNTAJE = '" + PUNTAJE.ToString().Replace(',', '.') + "', ";
            }
            else
            {
                sql += "0, ";
                informacion += "PUNTAJE = '0', ";
            }

            if (String.IsNullOrEmpty(CALIFICACION) == false)
            {
                sql += "'" + CALIFICACION + "', ";
                informacion += "CALIFICACION = '" + CALIFICACION + "', ";
            }
            else
            {
                MensajeError = "El campo CALIFICACION no puede ser vacio.";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(FORTALEZAS) == false)
            {
                sql += "'" + FORTALEZAS + "', ";
                informacion += "FORTALEZAS = '" + FORTALEZAS + "', ";
            }
            else
            {
                sql += "null, ";
                informacion += "FORTALEZAS = 'null', ";
            }

            if (String.IsNullOrEmpty(OPORTUNIDAD_MEJORAS) == false)
            {
                sql += "'" + OPORTUNIDAD_MEJORAS + "', ";
                informacion += "OPORTUNIDAD_MEJORAS = '" + OPORTUNIDAD_MEJORAS + "', ";
            }
            else
            {
                sql += "null, ";
                informacion += "OPORTUNIDAD_MEJORAS = 'null', ";
            }

            if (String.IsNullOrEmpty(CURSOS_CAPACITACIONES) == false)
            {
                sql += "'" + CURSOS_CAPACITACIONES + "', ";
                informacion += "CURSOS_CAPACITACIONES = '" + CURSOS_CAPACITACIONES + "', ";
            }
            else
            {
                sql += "null, ";
                informacion += "CURSOS_CAPACITACIONES = 'null', ";
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.GH_EVALUACIONES, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            return ejecutadoCorrectamente;
        }
예제 #15
0
        public Boolean DesligarEmpresaDeGrupoEmpresarial(Decimal ID_EMPRESA
            , Conexion conexion)
        {
            String sql = null;
            Boolean ejecutar = true;
            String informacion = null;

            tools _tools = new tools();

            Boolean verificador = true;

            sql = "usp_ven_empresas_quitar_grupo_empresarial ";

            #region validaciones
            if (ID_EMPRESA != 0)
            {
                sql += ID_EMPRESA + ", ";
                informacion += "ID_EMPRESA = " + ID_EMPRESA.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo ID EMPRESA no puede ser 0\n";
                ejecutar = false;
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario + "'";

            #endregion validaciones

            if (ejecutar == true)
            {
                try
                {
                    if (conexion.ExecuteNonQuery(sql) <= 0)
                    {
                        verificador = false;
                        MensajeError = "No se pudo realizar la actualización del cliente, error en UPDATE.";
                    }
                    else
                    {
                        #region auditoria
                        auditoria _auditoria = new auditoria(Empresa);
                        if (_auditoria.Adicionar(Usuario, tabla.VEN_EMPRESAS, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion) == false)
                        {
                            verificador = false;
                            MensajeError = _auditoria.MensajError;
                        }
                        #endregion auditoria
                    }
                }
                catch (Exception ex)
                {
                    verificador = false;
                    MensajeError = ex.Message;
                }
            }
            else
            {
                verificador = false;
            }

            return verificador;
        }
예제 #16
0
        public Decimal Retirar_empleado(Decimal ID_EMPLEADO, DateTime FECHA_RETIRO, Int32 ID_PERIODO)
        {
            String sql = null;
            Decimal rowsRet = 0;
            String informacion = null;
            Boolean ejecutar = true;
            tools _tools = new tools();

            sql = "usp_nom_nomina_novedades_retirar_1 ";

            #region validaciones
            if (ID_EMPLEADO != 0)
            {
                sql += "'" + ID_EMPLEADO.ToString() + "' ";
                informacion += "ID_EMPLEADO= '" + ID_EMPLEADO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo ID_EMPLEADO es requerido para la eliminacion.";
                ejecutar = false;
            }

            sql += ", '" + _tools.obtenerStringConFormatoFechaSQLServer(FECHA_RETIRO) + "', ";
            informacion += "FECHA_RETIRO = '" + FECHA_RETIRO.ToString() + "', ";

            if (ID_PERIODO != 0)
            {
                sql += "'" + ID_PERIODO.ToString() + "', ";
                informacion += "ID_PERIODO= '" + ID_EMPLEADO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo ID_PERIODO es requerido para la eliminacion.";
                ejecutar = false;
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_CRE = '" + Usuario.ToString() + "'";

            #endregion

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    rowsRet = conexion.ExecuteNonQuery(sql);

                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            return rowsRet;
        }
예제 #17
0
        public Boolean Actualizar(Int32 REGISTRO, String ESTADO)
        {
            Int32 cantidadRegistrosActualizados = 0;
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;

            sql = "usp_nom_nomina_novedades_actualizar_estado ";

            #region validaciones
            if (REGISTRO != 0)
            {
                sql += "'" + REGISTRO.ToString() + "', ";
                informacion += "REGISTRO= '" + REGISTRO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo REGISTRO es requerido para la consulta.";
                ejecutar = false;
            }
            if (!(String.IsNullOrEmpty(ESTADO)))
            {
                sql += "'" + ESTADO + "', ";
                informacion += "ESTADO = '" + ESTADO.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo ESTADO no puede ser nulo\n";
                ejecutar = false;
            }

            sql += "'" + Usuario + "' ";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";
            #endregion

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    cantidadRegistrosActualizados = conexion.ExecuteNonQuery(sql);
                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.NOM_NOMINA_NOVEDADES, tabla.ACCION_ANULAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            if (cantidadRegistrosActualizados > 0) return true;
            else return false;
        }
        public Boolean Actualizar(int ID_SEGURIDAD_SOCIAL, String DESCRIPCION, Decimal PORCENTAJE, String COD_CONTABLE)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            sql = "usp_par_prestacionales_actualizar ";

            #region validaciones
            if (ID_SEGURIDAD_SOCIAL != 0)
            {
                sql += ID_SEGURIDAD_SOCIAL + ", ";
                informacion += "ID_SEGURIDAD_SOCIAL = " + ID_SEGURIDAD_SOCIAL + ", ";
            }
            else
            {
                MensajeError += "El campo ID_SEGURIDAD_SOCIAL no puede ser 0\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(DESCRIPCION)))
            {
                sql += "'" + DESCRIPCION + "', ";
                informacion += "DESCRIPCION = '" + DESCRIPCION + "', ";
            }
            else
            {
                MensajeError += "El campo DESCRIPCION no puede ser nulo\n";
                ejecutar = false;
            }

            if (PORCENTAJE != 0)
            {
                sql += "'" + PORCENTAJE + "', ";
                informacion += "PORCENTAJE = '" + PORCENTAJE + "', ";
            }
            else
            {
                MensajeError += "El campo PORCENTAJE no puede ser cero\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(COD_CONTABLE)))
            {
                sql += "'" + COD_CONTABLE + "', ";
                informacion += "COD_CONTABLE = '" + COD_CONTABLE + "', ";
            }
            else
            {
                MensajeError += "El campo COD_CONTABLE no puede ser nulo\n";
                ejecutar = false;
            }

            sql += "'" + Usuario + "' ";
            informacion += "USU_CRE = '" + Usuario.ToString() + "' ";
            #endregion validaciones

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                conexion.IniciarTransaccion();
                try
                {
                    #region actualizar
                    if (conexion.ExecuteNonQuery(sql) == 0) ejecutadoCorrectamente = false;
                    #endregion actualizar

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    if (!(_auditoria.Adicionar(Usuario, tabla.PAR_SEGURIDAD_SOCIAL, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion))) ejecutadoCorrectamente = false;
                    #endregion auditoria

                    conexion.AceptarTransaccion();
                }
                catch (Exception e)
                {
                    conexion.DeshacerTransaccion();
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            else ejecutadoCorrectamente = false;

            if (ejecutadoCorrectamente) return true;
            else return false;
        }
예제 #19
0
        public Decimal EliminarNovedadPorId(Int32 REGISTRO)
        {
            String sql = null;
            Decimal rowsDeleted = 0;
            String informacion = null;
            Boolean ejecutar = true;

            sql = "usp_nom_nomina_novedades_eliminar ";

            #region validaciones
            if (REGISTRO != 0)
            {
                sql += "'" + REGISTRO.ToString() + "' ";
                informacion += "REGISTRO= '" + REGISTRO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo REGISTRO es requerido para la eliminacion.";
                ejecutar = false;
            }

            informacion += "USU_MOD = '" + Usuario.ToString() + "'";
            #endregion

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    rowsDeleted = conexion.ExecuteNonQuery(sql);
                    if (rowsDeleted > 0)
                    {
                        #region auditoria
                        auditoria _auditoria = new auditoria(Empresa);
                        _auditoria.Adicionar(Usuario, tabla.NOM_NOMINA_NOVEDADES, tabla.ACCION_ELIMINAR, sql, informacion, conexion);
                        #endregion auditoria
                    }
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            return rowsDeleted;
        }
        public Boolean Actualizar(Decimal ID_ENTIDAD,
            String NOMBRE,
            String DESCRIPCION,
            Boolean ACTIVO)
        {
            Conexion conexion = new Conexion(Empresa);
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            tools _tools = new tools();

            sql = "usp_prog_entidades_colaboradoras_actualizar ";

            #region validaciones

            if (ID_ENTIDAD != 0)
            {
                sql += ID_ENTIDAD + ", ";
                informacion += "ID_ENTIDAD = '" + ID_ENTIDAD + "', ";
            }
            else
            {
                MensajeError = "El campo ID_ENTIDAD no puede ser vacio.";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(NOMBRE) == false)
            {
                sql += "'" + NOMBRE + "', ";
                informacion += "NOMBRE = '" + NOMBRE + "', ";
            }
            else
            {
                MensajeError = "El campo NOMBRE no puede ser vacio.";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(DESCRIPCION) == false)
            {
                sql += "'" + DESCRIPCION + "', ";
                informacion += "DESCRIPCION = '" + DESCRIPCION + "', ";
            }
            else
            {
                MensajeError = "El campo DESCRIPCION no puede ser vacio.";
                ejecutar = false;
            }

            if (ACTIVO == true)
            {
                sql += "'True', ";
            }
            else
            {
                sql += "'False', ";
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.PROG_ENTIDADES_COLABORADORAS, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            return ejecutadoCorrectamente;
        }
        public Boolean Actualizar(int ID_UNIDAD_REPORTE, String DESCRIPCION, String DESC_ABREV, Boolean ACTIVO)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            sql = "usp_par_unidad_reporte_actualizar ";

            #region validaciones
            if (ID_UNIDAD_REPORTE != 0)
            {
                sql += ID_UNIDAD_REPORTE + ", ";
                informacion += "ID_UNIDAD_REPORTE = " + ID_UNIDAD_REPORTE + ", ";
            }
            else
            {
                MensajeError += "El campo ID_UNIDAD_REPORTE no puede ser 0\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(DESCRIPCION)))
            {
                sql += "'" + DESCRIPCION + "', ";
                informacion += "DESCRIPCION = '" + DESCRIPCION + "', ";
            }
            else
            {
                MensajeError += "El campo DESCRIPCION no puede ser nulo\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(DESC_ABREV)))
            {
                sql += "'" + DESC_ABREV + "', ";
                informacion += "DESC_ABREV = '" + DESC_ABREV + "', ";
            }
            else
            {
                MensajeError += "El campo DESC_ABREV no puede ser nulo\n";
                ejecutar = false;
            }

            informacion += "ACTIVO = '" + ACTIVO + "' ";

            if (ACTIVO) sql += "1,";
            else sql += "0,";

            sql += "'" + Usuario + "' ";
            informacion += "USU_CRE = '" + Usuario.ToString() + "' ";
            #endregion validaciones

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                conexion.IniciarTransaccion();
                try
                {
                    #region actualizar
                    if (conexion.ExecuteNonQuery(sql) == 0) ejecutadoCorrectamente = false;
                    #endregion actualizar

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    if (!(_auditoria.Adicionar(Usuario, tabla.PAR_UNIDAD_REPORTE, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion))) ejecutadoCorrectamente = false;
                    #endregion auditoria

                    conexion.AceptarTransaccion();
                }
                catch (Exception e)
                {
                    conexion.DeshacerTransaccion();
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            else ejecutadoCorrectamente = false;

            if (ejecutadoCorrectamente) return true;
            else return false;
        }
예제 #22
0
        public Boolean EliminarPruebaDePerfil(Decimal ID_PERFIL, Decimal ID_PRUEBA, Conexion conexion)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            sql = "usp_sel_reg_pruebas_perfil_eliminar_por_id_prueba ";

            if (ID_PERFIL != 0)
            {
                sql += ID_PERFIL + ", ";
                informacion += "ID_PERFIL = '" + ID_PERFIL.ToString() + "', ";
            }
            else
            {
                MensajeError = "El campo ID PERFIL no puede ser 0.";
                ejecutar = false;
            }

            if (ID_PRUEBA != 0)
            {
                sql += ID_PRUEBA;
                informacion += "ID_PRUEBA = '" + ID_PRUEBA + "'";
            }
            else
            {
                MensajeError = "El campo ID_PRUEBA no puede ser 0.";
                ejecutar = false;
            }
            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.SEL_REG_PRUEBAS_PERFIL, tabla.ACCION_ELIMINAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    ejecutadoCorrectamente = false;
                    MensajeError = "Error originado en logica de negocio(clase:. pruebaPerfil metodo:. eliminar): " + e.Message.ToString();
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            return ejecutadoCorrectamente;
        }
예제 #23
0
        public Boolean ActualizarNomEmpleadosAuditoria(Decimal ID_EMPLEADO,
            Decimal SALARIO,
            Decimal RIESGO,
            Decimal ID_ENTIDAD,
            String NUM_CUENTA,
            String SAL_INT,
            Decimal ID_PERFIL,
            String FORMA_PAGO,
            String ID_CIUDAD,
            Decimal ID_CENTRO_C,
            Decimal ID_SUB_C,
            Conexion conexion,
            String TIPO_CUENTA,
            DateTime FECHA_INICIO_PERIODO,
            String CHEQUE_REG)
        {
            Int32 cantidadRegistrosActualizados = 0;
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;

            tools _tools = new tools();

            sql = "usp_nom_empleados_actualizar_auditoria_V3 ";

            #region validaciones
            if (ID_EMPLEADO != 0)
            {
                sql += ID_EMPLEADO + ", ";
                informacion += "ID_EMPLEADO = '" + ID_EMPLEADO.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo ID_EMPLEADO no puede ser nulo\n";
                ejecutar = false;
            }

            if (SALARIO != 0)
            {
                sql += _tools.convierteComaEnPuntoParaDecimalesEnSQL(SALARIO) + ", ";
                informacion += "SALARIO = '" + _tools.convierteComaEnPuntoParaDecimalesEnSQL(SALARIO) + "', ";
            }
            else
            {
                sql += "0, ";
                informacion += "SALARIO = '0', ";
            }

            if (RIESGO != 0)
            {
                sql += RIESGO + ", ";
                informacion += "RIESGO = '" + RIESGO + "', ";
            }
            else
            {
                sql += "0, ";
                informacion += "RIESGO = '0', ";
            }

            if (ID_ENTIDAD != 0)
            {
                sql += ID_ENTIDAD + ", ";
                informacion += "ID_ENTIDAD = '" + ID_ENTIDAD.ToString() + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "ID_ENTIDAD = 'NULL', ";
            }

            if (String.IsNullOrEmpty(NUM_CUENTA) == false)
            {
                sql += "'" + NUM_CUENTA + "', ";
                informacion += "NUM_CUENTA = '" + NUM_CUENTA + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "NUM_CUENTA = 'NULL', ";
            }

            if (String.IsNullOrEmpty(SAL_INT) == false)
            {
                sql += "'" + SAL_INT + "', ";
                informacion += "SAL_INT = '" + SAL_INT + "', ";
            }
            else
            {
                MensajeError += "El campo SAL_INT no puede ser nulo\n";
                ejecutar = false;
            }

            if (ID_PERFIL != 0)
            {
                sql += ID_PERFIL + ", ";
                informacion += "ID_PERFIL = '" + ID_PERFIL + "', ";
            }
            else
            {
                MensajeError += "El campo ID_PERFIL no puede ser nulo\n";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(FORMA_PAGO) == false)
            {
                sql += "'" + FORMA_PAGO + "', ";
                informacion += "FORMA_PAGO = '" + FORMA_PAGO + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "FORMA_PAGO = 'NULL', ";
            }

            if (String.IsNullOrEmpty(ID_CIUDAD) == false)
            {
                sql += "'" + ID_CIUDAD + "', ";
                informacion += "ID_CIUDAD = '" + ID_CIUDAD + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "ID_CIUDAD = 'NULL', ";
            }

            if (ID_CENTRO_C != 0)
            {
                sql += ID_CENTRO_C + ", ";
                informacion += "ID_CENTRO_C = '" + ID_CENTRO_C + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "ID_CENTRO_C = 'NULL', ";
            }

            if (ID_SUB_C != 0)
            {
                sql += ID_SUB_C + ", ";
                informacion += "ID_SUB_C = '" + ID_SUB_C + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "ID_SUB_C = 'NULL', ";
            }

            sql += "'" + Usuario + "', ";
            informacion += "USU_MOD = '" + Usuario.ToString() + "', ";

            if (String.IsNullOrEmpty(TIPO_CUENTA) == false)
            {
                sql += "'" + TIPO_CUENTA + "', ";
                informacion += "TIPO_CUENTA = '" + TIPO_CUENTA + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "ID_CIUDAD = 'NULL', ";
            }

            if (!(String.IsNullOrEmpty(FECHA_INICIO_PERIODO.ToString())))
            {
                sql += "'" + _tools.obtenerStringConFormatoFechaSQLServer(FECHA_INICIO_PERIODO) + "', ";
                informacion += "FECHA_INICIO_PERIODO = '" + FECHA_INICIO_PERIODO.ToString() + "', ";
            }
            else
            {
                sql += "NULL, ";
                informacion += "FECHA_INICIO_PERIODO = null, ";
            }

            if (String.IsNullOrEmpty(CHEQUE_REG) == false)
            {
                sql += "'" + CHEQUE_REG + "'";
                informacion += "CHEQUE_REG = '" + CHEQUE_REG.ToString() + "'";
            }
            else
            {
                sql += "NULL";
                informacion += "CHEQUE_REG = 'NULL'";
            }

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    cantidadRegistrosActualizados = conexion.ExecuteNonQuery(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.NOM_EMPLEADOS, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
            }

            if (cantidadRegistrosActualizados > 0) return true;
            else return false;
        }
예제 #24
0
        public Boolean Adicionar(Decimal ID_PERFIL, Decimal ID_PRUEBA, Conexion conexion)
        {
            String sql = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            sql = "usp_sel_reg_pruebas_perfil_adicionar ";

            if (ID_PERFIL != 0) sql += ID_PERFIL + ", ";
            else
            {
                MensajeError = "El campo ID_PERFIL no puede ser 0\n";
                ejecutar = false;
            }

            if (ID_PRUEBA != 0) sql += ID_PRUEBA + ", ";
            else
            {
                MensajeError += "El campo ID_PRUEBA no puede vacio. \n";
                ejecutar = false;
            }

            sql += "'" + Usuario + "'";

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.SEL_REG_PRUEBAS_PERFIL, tabla.ACCION_ADICIONAR, sql, null, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    ejecutadoCorrectamente = false;
                    MensajeError = "Error originado en logica de negocio(clase:. pruebaPerfil metodo:. adicionar): " + e.Message.ToString();
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            return ejecutadoCorrectamente;
        }
예제 #25
0
        public String ElaborarContrato(int id_requerimiento, int id_solicitud, int id_empresa, int id_centro_Costo, int id_sub_cc, String ciudad,
            int ID_SERVICIO_RESPECTIVO, int servicio, int id_ARP, int id_caja_c, int id_EPS, int id_Pensiones, Decimal riesgo, String pensionado,
            String Clase_Contrato, String Tipo_Contrato, String Tipo_Pago, DateTime fecha_Inicia, DateTime fecha_termina, String sal_int,
            Decimal Salario, String vigente, String activo, String liquidado, String pago_Liquidacion, int id_entidad, String Num_Cuenta, String Forma_pago,
            String PAGO_DIAS_PRODUCTIVIDAD, String SENA_PRODICTIVO, String SENA_ELECTIVO, String PRACTICANTE_UNIVERSITARIO, Decimal VALOR_NOMINA, Decimal VALOR_CONTRATO,
            DateTime FECHA_INICIO_PERIODO, DateTime FECHA_FIN_PERIODO, String Periodo_Pago, String tipo_Cuenta, string descripcion_salario, decimal idPerfil)
        {
            String datosG = "";
            int id_perfil = 0;
            Conexion conexion = new Conexion(Empresa);
            conexion.IniciarTransaccion();

            try
            {
                requisicion _req = new requisicion(Empresa, Usuario);
                DataTable tablaReq = _req.ObtenerComRequerimientoPorIdRequerimiento(Convert.ToDecimal(id_requerimiento), conexion);

                DataRow filaReq = tablaReq.Rows[0];
                id_perfil = Convert.ToInt32(filaReq["REGISTRO_PERFIL"].ToString());
                usuario _empleado = new usuario(Empresa);
                radicacionHojasDeVida _sol = new radicacionHojasDeVida(Empresa, Usuario);

                Decimal idEmpleado = _empleado.AdicionarNomEmpleados(0, id_solicitud, id_empresa, id_centro_Costo, id_sub_cc, fecha_Inicia, Salario,
                    pensionado, activo, liquidado, riesgo, id_ARP, id_caja_c, id_EPS, id_Pensiones, "C", id_entidad, Num_Cuenta, sal_int, ciudad, id_perfil, tipo_Cuenta, descripcion_salario, Forma_pago, conexion);

                if (idEmpleado <= 0)
                {
                    _mensaje_error = "\n El empleado no fue creado, " + _empleado.MensajeError;
                    conexion.DeshacerTransaccion();
                }
                else
                {
                    registroContrato _contrato = new registroContrato(Empresa, Usuario);

                    Decimal id_Contrato = 0;
                    /* revisado por cambio en riesgo */
                    id_Contrato = _contrato.AdicionarConRegContratos(Convert.ToInt32(idEmpleado), id_requerimiento, id_solicitud, id_centro_Costo,
                        id_sub_cc, Clase_Contrato, fecha_Inicia, fecha_termina, vigente, pago_Liquidacion, sal_int, Tipo_Contrato,
                        ID_SERVICIO_RESPECTIVO, ciudad, servicio, conexion, PAGO_DIAS_PRODUCTIVIDAD, SENA_PRODICTIVO, SENA_ELECTIVO, PRACTICANTE_UNIVERSITARIO,
                        VALOR_NOMINA, VALOR_CONTRATO, FECHA_INICIO_PERIODO, FECHA_FIN_PERIODO, Periodo_Pago);

                    if (String.IsNullOrEmpty(_contrato.MensajeError))
                    {
                        _empleado.ActualizarNomEmpleados(Convert.ToInt32(idEmpleado), Convert.ToInt32(id_Contrato), id_solicitud, id_empresa, id_centro_Costo, id_sub_cc, fecha_Inicia, Salario,
                        pensionado, activo, liquidado, riesgo, id_ARP, id_caja_c, id_EPS, id_Pensiones, "C", id_entidad, Num_Cuenta, sal_int, ciudad, id_perfil, Forma_pago, conexion);

                        if (String.IsNullOrEmpty(_empleado.MensajeError))
                        {

                            if (_sol.ActualizarEstadoProcesoRegSolicitudesIngreso(id_requerimiento, id_solicitud, "CONTRATADO", Usuario, conexion))
                            {
                                if (_sol.ActualizarEstadoRegSolicitudesIngreso(id_requerimiento, id_solicitud, "CONTRATADO", conexion))
                                {
                                    datosG = id_Contrato + "," + idEmpleado;

                                    try
                                    {
                                        conexion.ExecuteNonQuery("usp_ESC_CRT_ENTREGAS_SC_adicionar " + idEmpleado + ", '" + Usuario + "'");
                                        conexion.ExecuteNonQuery("usp_empleado_clausulas_contratar " + idEmpleado + ", " + idPerfil + ", '" + Usuario + "'");

                                        Int32 requerimientoActualizado = Convert.ToInt32(conexion.ExecuteScalar("usp_comprobar_cierre_requisicion_por_sistema " + id_requerimiento.ToString() + ", '" + Usuario + "'"));

                                        if (requerimientoActualizado <= 0)
                                        {
                                            conexion.DeshacerTransaccion();
                                            MensajeError = "El empleado no fue creado, Ocurrio un error al momento de determinar si la requisición debe ser cuplida por sistema.";
                                        }
                                        else
                                        {
                                            conexion.AceptarTransaccion();
                                        }
                                    }
                                    catch
                                    {
                                        _mensaje_error += "\n No fue posible registrar los servicios complementarios o clausulas para el perfil contratado " + _sol.MensajeError;
                                        conexion.AceptarTransaccion();
                                    }
                                }
                                else
                                {
                                    _mensaje_error += "\n No fue posible actualizar el estado de la solicitud: " + _sol.MensajeError;
                                    conexion.DeshacerTransaccion();
                                }
                            }
                            else
                            {
                                _mensaje_error += "\n No fue posible actualizar el estado del proceso de la soliciutd: " + _sol.MensajeError;
                                conexion.DeshacerTransaccion();
                            }

                        }
                        else
                        {
                            _mensaje_error += "\n Se presentó el siguiente error en la actualización del empleado: " + _empleado.MensajeError;
                            conexion.DeshacerTransaccion();
                        }
                    }
                    else
                    {
                        _mensaje_error += "\n Se presentó el siguiente error en la creación del contrato: " + _contrato.MensajeError;
                        conexion.DeshacerTransaccion();
                    }
                }
            }
            catch (Exception e)
            {
                MensajeError = e.Message;
                conexion.DeshacerTransaccion();
            }
            finally
            {
                conexion.Desconectar();
            }

            return datosG;
        }
예제 #26
0
        public Boolean ActualizarPresupuestoGeneral(Decimal ID_PRES_GEN,
            Decimal MONTO,
            String DESCRIPCION)
        {
            Conexion conexion = new Conexion(Empresa);
            conexion.IniciarTransaccion();

            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            int numRegistrosAfectados = 0;

            tools _tools = new tools();

            sql = "usp_prog_presupuestos_generales_actualizar ";

            #region validaciones
            if (ID_PRES_GEN != 0)
            {
                sql += ID_PRES_GEN + ", ";
                informacion += "ID_PRES_GEN = '" + ID_PRES_GEN + "', ";
            }
            else
            {
                MensajeError = "El campo ID_PRES_GEN no puede ser vacio.";
                ejecutar = false;
            }

            if (MONTO != 0)
            {
                sql += MONTO.ToString().Replace(",", ".") + ", ";
                informacion += "MONTO = '" + MONTO.ToString() + "', ";
            }
            else
            {
                MensajeError = "El campo MONTO no puede ser vacio.";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(DESCRIPCION) == false)
            {
                sql += "'" + DESCRIPCION + "', ";
                informacion += "DESCRIPCION = '" + DESCRIPCION + "', ";
            }
            else
            {
                MensajeError = "El campo DESCRIPCION no puede ser vacio.";
                ejecutar = false;
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    numRegistrosAfectados = conexion.ExecuteNonQuery(sql);

                    if (numRegistrosAfectados <= 0)
                    {
                        conexion.DeshacerTransaccion();
                        numRegistrosAfectados = 0;
                        ejecutadoCorrectamente = false;
                    }
                    else
                    {
                        auditoria _auditoria = new auditoria(Empresa);

                        if (_auditoria.Adicionar(Usuario, tabla.PROG_PRESUPUESTOS_GENERALES, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion) == false)
                        {
                            conexion.DeshacerTransaccion();
                            numRegistrosAfectados = 0;
                            ejecutadoCorrectamente = false;
                        }
                    }

                    if (ejecutadoCorrectamente == true)
                    {
                        conexion.AceptarTransaccion();
                    }
                }
                catch (Exception e)
                {
                    conexion.DeshacerTransaccion();
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                    numRegistrosAfectados = 0;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
                numRegistrosAfectados = 0;
            }

            if (ejecutadoCorrectamente)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
예제 #27
0
        public Boolean ActualizarConRegExamenesEmpleado(Decimal REGISTRO,
            Decimal ID_ORDEN,
            Decimal ID_EXAMEN,
            Decimal COSTO,
            String VALIDADO,
            DateTime FECHA_EXAMEN,
            Conexion conexion)
        {
            Int32 cantidadRegistrosActualizados = 0;
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;

            tools _tools = new tools();

            sql = "USP_CON_REG_EXAMENES_EMPLEADO_ACTUALIZAR ";

            #region validaciones
            if (REGISTRO != 0)
            {
                sql += REGISTRO + ", ";
                informacion += "REGISTRO = '" + REGISTRO.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo REGISTRO no puede ser nulo\n";
                ejecutar = false;
            }
            if (ID_ORDEN != 0)
            {
                sql += ID_ORDEN + ", ";
                informacion += "ID_ORDEN = '" + ID_ORDEN.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo ID_ORDEN no puede ser nulo\n";
                ejecutar = false;
            }
            if (ID_EXAMEN != 0)
            {
                sql += ID_EXAMEN + ", ";
                informacion += "ID_EXAMEN = '" + ID_EXAMEN.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo ID_EXAMEN no puede ser nulo\n";
                ejecutar = false;
            }
            if (COSTO != 0)
            {
                sql += _tools.convierteComaEnPuntoParaDecimalesEnSQL(COSTO) + ", ";
                informacion += "COSTO = '" + COSTO.ToString() + "', ";
            }
            else
            {
                sql += "0, ";
                informacion += "COSTO = '0', ";
            }
            if (!(String.IsNullOrEmpty(VALIDADO)))
            {
                sql += "'" + VALIDADO + "', ";
                informacion += "VALIDADO = '" + VALIDADO.ToString() + "', ";
            }
            else
            {
                sql += "'N', ";
                informacion += "VALIDADO = 'N', ";
            }
            if (!(String.IsNullOrEmpty(FECHA_EXAMEN.ToString())))
            {
                sql += "'" + _tools.obtenerStringConFormatoFechaSQLServer(FECHA_EXAMEN) + "', ";
                informacion += "FECHA_EXAMEN = '" + FECHA_EXAMEN.ToString() + "', ";
            }

            sql += "'" + Usuario + "' ";
            informacion += "USU_MOD= '" + Usuario.ToString() + "' ";

            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    cantidadRegistrosActualizados = conexion.ExecuteNonQuery(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.CON_REG_EXAMENES_EMPLEADO, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    cantidadRegistrosActualizados = 0;
                }
            }

            if (cantidadRegistrosActualizados > 0) return true;
            else return false;
        }
예제 #28
0
        public Boolean ActualizarPresupuesto(Decimal ID_PRESUPUESTO,
            Decimal PRESUPUESTO,
            String OBSERVACIONES)
        {
            Conexion conexion = new Conexion(Empresa);
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            tools _tools = new tools();

            sql = "usp_prog_presupuestos_actualizar ";

            #region validaciones
            if (ID_PRESUPUESTO != 0)
            {
                sql += ID_PRESUPUESTO + ", ";
                informacion += "ID_PRESUPUESTO = '" + ID_PRESUPUESTO + "', ";
            }
            else
            {
                MensajeError = "El campo ID_PRESUPUESTO no puede ser vacio.";
                ejecutar = false;
            }

            if (PRESUPUESTO != 0)
            {
                sql += PRESUPUESTO.ToString().Replace(',', '.') + ", ";
                informacion += "PRESUPUESTO = '" + PRESUPUESTO.ToString().Replace(',', '.') + "', ";
            }
            else
            {
                MensajeError = "El campo ID_PRESUPUESTO no puede ser vacio.";
                ejecutar = false;
            }

            if (String.IsNullOrEmpty(OBSERVACIONES) == false)
            {
                sql += "'" + OBSERVACIONES + "', ";
                informacion += "OBSERVACIONES = '" + OBSERVACIONES + "', ";
            }
            else
            {
                MensajeError = "El campo OBSERVACIONES no puede ser vacio.";
                ejecutar = false;
            }

            sql += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario.ToString() + "'";
            #endregion validaciones

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);

                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.PROG_PRESUPUESTOS, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    ejecutadoCorrectamente = false;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            if (ejecutadoCorrectamente)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
예제 #29
0
        public Boolean Actualizar(Decimal ID_AFP, String NIT, String DIG_VER, String COD_ENTIDAD, String NOM_ENTIDAD, String DIR_ENTIDAD,
            String TEL_ENTIDAD, String CONTACTO, String CARGO, bool ESTADO)
        {
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            Boolean ejecutadoCorrectamente = true;

            sql = "usp_con_ent_afp_actualizar ";

            #region validaciones

            if (ID_AFP != 0)
            {
                sql += ID_AFP + ", ";
                informacion += "ID_AFP = '" + ID_AFP + "', ";
            }
            else
            {
                MensajeError += "El campo ID_AFP no puede ser 0\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(NIT)))
            {
                sql += "'" + NIT + "', ";
                informacion += "NIT = '" + NIT + "', ";
            }
            else
            {
                MensajeError += "El campo NIT no puede ser nulo\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(DIG_VER)))
            {
                sql += "'" + DIG_VER + "', ";
                informacion += "DIG_VER = '" + DIG_VER + "', ";
            }
            else
            {
                MensajeError += "El campo DIGITO DE VERIFICACION no puede ser nulo\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(COD_ENTIDAD)))
            {
                sql += "'" + COD_ENTIDAD + "', ";
                informacion += "COD_ENTIDAD = '" + COD_ENTIDAD + "', ";
            }
            else
            {
                MensajeError += "El campo CODIGO DE ENTIDAD no puede ser nulo\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(NOM_ENTIDAD)))
            {
                sql += "'" + NOM_ENTIDAD + "', ";
                informacion += "NOM_ENTIDAD = '" + NOM_ENTIDAD + "', ";
            }
            else
            {
                MensajeError += "El campo NOMBRE DE ENTIDAD no puede ser nulo\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(DIR_ENTIDAD)))
            {
                sql += "'" + DIR_ENTIDAD + "', ";
                informacion += "DIR_ENTIDAD = '" + DIR_ENTIDAD + "', ";
            }
            else
            {
                MensajeError += "El campo DIRECCION DE ENTIDAD no puede ser nulo\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(TEL_ENTIDAD)))
            {
                sql += "'" + TEL_ENTIDAD + "', ";
                informacion += "TEL_ENTIDAD = '" + TEL_ENTIDAD + "', ";
            }
            else
            {
                MensajeError += "El campo TELEFONO DE ENTIDAD no puede ser nulo\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(CONTACTO)))
            {
                sql += "'" + CONTACTO + "', ";
                informacion += "CONTACTO = '" + CONTACTO + "', ";
            }
            else
            {
                MensajeError += "El campo CONTACTO no puede ser nulo\n";
                ejecutar = false;
            }

            if (!(String.IsNullOrEmpty(CARGO)))
            {
                sql += "'" + CARGO + "', ";
                informacion += "CARGO = '" + CARGO + "', ";
            }
            else
            {
                MensajeError += "El campo CARGO no puede ser nulo\n";
                ejecutar = false;
            }

            sql += "'" + Usuario + "', ";
            informacion += "USU_CRE = '" + Usuario.ToString() + "', ";

            if (ESTADO) sql += "'S'";
            else sql += "'N'";
            #endregion validaciones

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                conexion.IniciarTransaccion();
                try
                {
                    #region adicionar entidad
                    if (conexion.ExecuteNonQuery(sql) == 0) ejecutadoCorrectamente = false;
                    #endregion adicionar entidad

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    if (!(_auditoria.Adicionar(Usuario, tabla.CON_ENT_F_PENSIONES, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion))) ejecutadoCorrectamente = false;
                    #endregion auditoria

                    conexion.AceptarTransaccion();
                }
                catch (Exception e)
                {
                    conexion.DeshacerTransaccion();
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            if (ejecutadoCorrectamente) return true;
            else return false;
        }
예제 #30
0
        public Boolean Actualizar(Int32 REGISTRO, Decimal ID_EMPLEADO, Int32 ID_CONCEPTO, Decimal CANTIDAD, Decimal VALOR, DateTime FECHA)
        {
            Int32 cantidadRegistrosActualizados = 0;
            String sql = null;
            String informacion = null;
            Boolean ejecutar = true;
            tools _tools = new tools();

            sql = "usp_nom_nomina_novedades_actualizar ";

            #region validaciones
            if (REGISTRO != 0)
            {
                sql += "'" + REGISTRO.ToString() + "', ";
                informacion += "REGISTRO= '" + REGISTRO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo REGISTRO es requerido para la consulta.";
                ejecutar = false;
            }
            if (ID_EMPLEADO != 0)
            {
                sql += "'" + ID_EMPLEADO.ToString() + "', ";
                informacion += "ID_EMPLEADO= '" + ID_EMPLEADO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo ID_EMPLEADO es requerido para la consulta.";
                ejecutar = false;
            }
            if (ID_CONCEPTO != 0)
            {
                sql += "'" + ID_CONCEPTO.ToString() + "', ";
                informacion += "ID_CONCEPTO= '" + ID_CONCEPTO.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo ID_CONCEPTO es requerido para la consulta.";
                ejecutar = false;
            }
            if (CANTIDAD != 0)
            {
                sql += "'" + CANTIDAD.ToString() + "', ";
                informacion += "CANTIDAD= '" + CANTIDAD.ToString() + ", ";
            }
            else
            {
                MensajeError = "El campo CANTIDAD es requerido para la consulta.";
                ejecutar = false;
            }
            sql += "'" + VALOR.ToString() + "', ";
            informacion += "VALOR= '" + VALOR.ToString() + ", ";

            sql += "'" + _tools.obtenerStringConFormatoFechaSQLServer(FECHA) + "', ";
            informacion += "FECHA = '" + FECHA.ToString() + "', ";

            sql += "'" + Usuario + "' ";
            informacion += "USU_CRE = '" + Usuario.ToString() + "'";
            #endregion

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    cantidadRegistrosActualizados = conexion.ExecuteNonQuery(sql);
                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.NOM_NOMINA_NOVEDADES, tabla.ACCION_ACTUALIZAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            if (cantidadRegistrosActualizados > 0) return true;
            else return false;
        }