Example #1
0
        private Boolean Eliminar(Conexion conexion, String TIPO)
        {
            Boolean ejecutar = true;
            String  sql      = null;
            Int32   i        = 0;

            if (TIPO == "puc")
            {
                sql = "usp_par_contable_puc_eliminar ";
            }
            else
            {
                sql = "usp_par_contable_centros_eliminar ";
            }

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

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.PAR_CONTABLE_PUC, tabla.ACCION_ELIMINAR, sql, sql, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
            }
            return(true);
        }
Example #2
0
        public DataTable ObtenerTodas()
        {
            Conexion  conexion    = new Conexion(Empresa);
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;

            sql = "usp_par_unidad_reporte_obtenerTodos ";

            try
            {
                _dataSet   = conexion.ExecuteReader(sql);
                _dataView  = _dataSet.Tables[0].DefaultView;
                _dataTable = _dataView.Table;

                #region auditoria
                auditoria _auditoria = new auditoria(Empresa);
                _auditoria.Adicionar(Usuario, tabla.PAR_SEGURIDAD_SOCIAL, tabla.ACCION_CONSULTAR.ToString(), sql, informacion, conexion);
                #endregion auditoria
            }
            catch (Exception e)
            {
                MensajeError = e.Message;
            }
            finally
            {
                conexion.Desconectar();
            }

            return(_dataTable);
        }
        public DataTable ObtenerPorId(int ID_PAR_INCAPACIDADES)
        {
            Conexion  conexion    = new Conexion(Empresa);
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;

            sql = "usp_par_incapacidades_obtenerPorId " + ID_PAR_INCAPACIDADES;

            try
            {
                _dataSet   = conexion.ExecuteReader(sql);
                _dataView  = _dataSet.Tables[0].DefaultView;
                _dataTable = _dataView.Table;

                #region auditoria
                auditoria _auditoria = new auditoria(Empresa);
                _auditoria.Adicionar(Usuario, tabla.PAR_INCAPACIDADES, tabla.ACCION_CONSULTAR.ToString(), sql, informacion, conexion);
                #endregion auditoria
            }
            catch (Exception e)
            {
                MensajeError = e.Message;
            }
            finally
            {
                conexion.Desconectar();
            }

            return(_dataTable);
        }
Example #4
0
        public Decimal Adicionar(Decimal ID_EMPRESA, String DESCRIPCION_RIESGO, Conexion conexion)
        {
            String  sql          = null;
            String  idRecuperado = null;
            String  informacion  = null;
            Boolean ejecutar     = true;

            sql = "usp_ven_empresas_riesgos_adicionar ";

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

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

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

            if (ejecutar)
            {
                try
                {
                    idRecuperado = conexion.ExecuteScalar(sql);

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.VEN_EMPRESAS_RIESGOS, 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 DataTable ObtenerAlmRegProductosProveedorPorProductoCiudad(int ID_PRODUCTO, String ID_CIUDAD)
        {
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;
            Boolean   ejecutar    = true;

            sql = "USP_ALM_REG_PRODUCTOS_PROVEEDOR_OBTENER_PROVEEDORES_POR_EXAMEN ";

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


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

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    _dataSet   = conexion.ExecuteReader(sql);
                    _dataView  = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;

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

            return(_dataTable);
        }
        public Boolean DesactivarServicioRespectivo(Decimal ID_SERVICIO_RESPECTIVO,
                                                    String USU_MOD,
                                                    Conexion conexion)
        {
            Int32   cantidadRegistrosActualizados = 0;
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            tools _tools = new tools();

            sql = "usp_ven_r_servicios_respectivos_desactivar ";

            if (ID_SERVICIO_RESPECTIVO != 0)
            {
                sql         += ID_SERVICIO_RESPECTIVO + ", ";
                informacion += "ID_SERVICIO_RESPECTIVO = " + ID_SERVICIO_RESPECTIVO + ", ";
            }
            else
            {
                MensajeError = "El campo ID DE SERVICIO RESPECTIVO no puede ser 0\n";
                ejecutar     = false;
            }

            if (!(String.IsNullOrEmpty(USU_MOD)))
            {
                sql         += "'" + USU_MOD + "'";
                informacion += "USU_MOD = '" + USU_MOD.ToString() + "'";
            }
            else
            {
                MensajeError += "El campo USUARIO QUE MODIFICĂ“ no puede ser nulo\n";
                ejecutar      = false;
            }

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

            if (cantidadRegistrosActualizados > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public Boolean OcultarRecFuentes(Decimal ID_FUENTE)
        {
            Int32   cantidadRegistrosActualizados = 0;
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            tools _tools = new tools();

            sql = "usp_rec_fuentes_ocultar ";

            #region validaciones

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

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

            #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.REC_FUENTES, 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);
            }
        }
Example #8
0
        private DataTable Llenar(Decimal ID_REQUERIMIENTO, Decimal ID_SOLICITUD)
        {
            Conexion  conexion    = new Conexion(Empresa);
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;
            Boolean   ejecutar    = true;

            sql = "usp_sel_control_requisitos_obtenerPorIdentificador ";

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

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

            if (ejecutar)
            {
                try
                {
                    _dataSet   = conexion.ExecuteReader(sql);
                    _dataView  = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;

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

            return(_dataTable);
        }
        public DataTable ObtenerTrasladosAlmRegDocumentoTempPorEstado(String ESTADO, String TIPO_DOC)
        {
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;
            Boolean   ejecutar    = true;

            sql = "USP_ALM_DOCUMENTOS_TEMP_OBTENER_POR_ESTADO ";

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

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

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    _dataSet   = conexion.ExecuteReader(sql);
                    _dataView  = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;

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

            return(_dataTable);
        }
Example #10
0
        public DataTable ObtenerAlmRegProveedorPorNombreConInfoCriteriosCalificacion(String NOM_PROVEEDOR, String TIPO_PROCESO)
        {
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;
            Boolean   ejecutar    = true;

            sql = "usp_alm_reg_proveedor_obtener_por_nombre_y_tipo_con_info_criterios ";

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

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

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    _dataSet   = conexion.ExecuteReader(sql);
                    _dataView  = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;

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

            return(_dataTable);
        }
        public String ActualizarFechaPeriodo(Decimal ID_EMPRESA, String PERIODOSPROCESO, DateTime FECHA)
        {
            Conexion conexion = new Conexion(Empresa);

            conexion.IniciarTransaccion();
            Boolean ejecutar    = true;
            String  sql         = null;
            String  informacion = null;
            String  actualizado = "N";
            tools   fecha       = new tools();

            sql = "usp_actualizar_fecha_memorando ";

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

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

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

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

            if (ejecutar)
            {
                try
                {
                    conexion.ExecuteNonQuery(sql);
                    actualizado = "S";
                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.NOM_PERIODO, tabla.ACCION_LIQUIDAR, sql, informacion, conexion);
                    #endregion auditoria
                    conexion.AceptarTransaccion();
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                    conexion.DeshacerTransaccion();
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            return(actualizado);
        }
Example #12
0
        public ActionResult DeleteConfirmed(int id)
        {
            auditoria auditoria = db.auditoria.Find(id);

            db.auditoria.Remove(auditoria);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #13
0
        public DataTable ObtenerConRegOrdenExamenPorSolicitud(int ID_REQUERIMIENTO, int ID_SOLICITUD)
        {
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;
            Boolean   ejecutar    = true;

            sql = "USP_CON_REG_ORDEN_EXAMEN_OBTENER_POR_REQUERIMINETO_SOLICITUD ";

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

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    _dataSet   = conexion.ExecuteReader(sql);
                    _dataView  = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;

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

            return(_dataTable);
        }
Example #14
0
        public DataTable ObtenerconBancoEmpresaPorCiudadEmpresa(String ID_CIUDAD, int ID_EMPRESA)
        {
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;
            Boolean   ejecutar    = true;

            sql = "USP_CON_BANCO_EMPRESA_OBTENER_BANCOS_POR_CIUDAD ";

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

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    _dataSet   = conexion.ExecuteReader(sql);
                    _dataView  = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;

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

            return(_dataTable);
        }
Example #15
0
        private Decimal ingresarPruebaSinManual(String NOM_PRUEBA, int ID_CATEGORIA, String OBS_PRUEBA)
        {
            String  sql             = null;
            String  idRecComFuentes = null;
            String  informacion     = null;
            Boolean ejecutar        = true;

            tools _tools = new tools();

            sql = "usp_sel_pruebas_adicionar ";

            #region validaciones

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

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

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

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

            #endregion validaciones

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    idRecComFuentes = conexion.ExecuteScalar(sql);

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

            if (!(String.IsNullOrEmpty(idRecComFuentes)))
            {
                return(Convert.ToDecimal(idRecComFuentes));
            }
            else
            {
                return(0);
            }
        }
        public DataTable ObtenerConRegServicioPerfilCentroC(int ID_PERFIL, String ID_CIUDAD)
        {
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;
            Boolean   ejecutar    = true;

            sql = "USP_CON_REG_SERVICIO_PERFIL_OBTENER_CC ";

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

            if (!(String.IsNullOrEmpty(ID_CIUDAD)))
            {
                sql         += ID_CIUDAD;
                informacion += "ID_CIUDAD= '" + ID_CIUDAD.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo ID_CIUDAD no puede ser nulo\n";
                ejecutar      = false;
            }
            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    _dataSet   = conexion.ExecuteReader(sql);
                    _dataView  = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;

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

            return(_dataTable);
        }
        public String ReversarNomina(Decimal ID_EMPRESA, String ESTADO, Int32 ID_PERIODO, String PERIODOSPROCESO)
        {
            Conexion conexion    = new Conexion(Empresa);
            Boolean  ejecutar    = true;
            String   sql         = null;
            String   Reversado   = "N";
            String   informacion = null;

            sql = "usp_reversar_nomina ";

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

            if (ID_EMPRESA > 0)
            {
                sql         += ID_EMPRESA.ToString() + ", ";
                informacion += "ID_EMPRESA ='" + ID_EMPRESA.ToString() + "', ";
            }
            else
            {
                MensajeError = "El campo ID_EMPRESA es requerido para la consulta.";
                ejecutar     = false;
            }


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

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

            #endregion

            if (ejecutar == true)
            {
                try
                {
                    conexion.ExecuteScalar(sql);
                    Reversado = "S";
                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(Usuario, tabla.NOM_PERIODO, tabla.ACCION_REVERSAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajeError = e.Message;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }
            return(Reversado);
        }
        public Boolean cerrarInvestigacionAdministrativa(Decimal ID_INVESTIGACION)
        {
            Int32   cantidadRegistrosActualizados = 0;
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            tools _tools = new tools();

            sql = "usp_con_reg_investigaciones_administrativas_cerrar ";

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

            sql         += "'" + Usuario + "'";
            informacion += "USU_MOD = '" + Usuario + "'";
            #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_INVSTIGACIONES_ADMINISTRATIVAS, 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);
            }
        }
Example #19
0
        public Decimal AdicionarResultadoEntrevistaRetiro(Decimal ID_MAESTRA_ROTACION_EMPLEADO,
                                                          Decimal ID_ROTACION_EMPRESA,
                                                          Conexion conexion)
        {
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            Decimal ID_DETALLE_ROTACION_EMPLEADO = 0;

            sql = "usp_sel_reg_detalle_rotacion_empleado_adicionar ";

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

            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 nulo\n";
                ejecutar      = false;
            }

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

            if (ejecutar)
            {
                try
                {
                    ID_DETALLE_ROTACION_EMPLEADO = Convert.ToDecimal(conexion.ExecuteScalar(sql));

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

            return(ID_DETALLE_ROTACION_EMPLEADO);
        }
Example #20
0
        public DataTable ObtenerAlmLoteTallaPorIdProductoBodega(int ID_PRODUCTO, int ID_BODEGA)
        {
            DataSet   _dataSet    = new DataSet();
            DataView  _dataView   = new DataView();
            DataTable _dataTable  = new DataTable();
            String    sql         = null;
            String    informacion = null;
            Boolean   ejecutar    = true;

            sql = "USP_ALM_LOTE_OBTENER_TALLA_POR_ID_BODEGA_ID_PRODUCTO ";

            if (ID_PRODUCTO != 0)
            {
                sql         += ID_PRODUCTO + ", ";
                informacion += "ID_PRODUCTO= '" + ID_PRODUCTO.ToString() + "', ";
            }
            else
            {
                MensajeError += "El campo ID_PRODUCTO no puede ser nulo\n";
                ejecutar      = false;
            }
            if (ID_BODEGA != 0)
            {
                sql         += ID_BODEGA + " ";
                informacion += "ID_BODEGA = '" + ID_BODEGA.ToString() + "' ";
            }
            else
            {
                MensajeError += "El campo ID_BODEGA no puede ser nulo\n";
                ejecutar      = false;
            }
            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    _dataSet   = conexion.ExecuteReader(sql);
                    _dataView  = _dataSet.Tables[0].DefaultView;
                    _dataTable = _dataView.Table;

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

            return(_dataTable);
        }
        public Decimal ObtenerAlmRegProductosProveedorPorProductoProveedor(int ID_PRODUCTO, int ID_PROVEEDOR, Conexion conexion)
        {
            String  sql           = null;
            String  informacion   = null;
            Boolean ejecutar      = true;
            String  identificador = null;

            sql = "USP_ALM_REG_PRODUCTOS_PROVEEDOR_OBTENER_REGISTRO_POR_PRODUCTO_PROVEEDOR ";

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

            if (ejecutar)
            {
                try
                {
                    identificador = conexion.ExecuteScalar(sql);

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

            if (!(String.IsNullOrEmpty(identificador)))
            {
                return(Convert.ToDecimal(identificador));
            }
            else
            {
                return(0);
            }
        }
Example #22
0
        public Boolean EliminarDocumentoDePerfil(Decimal ID_PERFIL, Decimal ID_DOCUMENTO, Conexion conexion)
        {
            String  sql                    = null;
            String  informacion            = null;
            Boolean ejecutar               = true;
            Boolean ejecutadoCorrectamente = true;

            sql = "usp_sel_reg_documentos_eliminar_por_id_documento ";

            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_DOCUMENTO != 0)
            {
                sql         += ID_DOCUMENTO;
                informacion += "ID_DOCUMENTO = '" + ID_DOCUMENTO.ToString() + "'";
            }
            else
            {
                MensajeError = "El campo ID_DOCUMENTO 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_DOCUMENTOS_PERFIL, tabla.ACCION_ELIMINAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    ejecutadoCorrectamente = false;
                    MensajeError           = "Error originado en logica de negocio(clase:. documentoPerfil metodo:. eliminar): " + e.Message.ToString();
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }

            return(ejecutadoCorrectamente);
        }
Example #23
0
        public Decimal AdicionarMotivoAsociadoAEmpresa(Decimal ID_EMPRESA, Decimal ID_DETALLE_ROTACION, Conexion conexion)
        {
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            Decimal ID_ROTACION_EMPRESA = 0;

            sql = "usp_sel_reg_rotacion_retiros_empresa_adicionar ";

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

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

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

            if (ejecutar)
            {
                try
                {
                    ID_ROTACION_EMPRESA = Convert.ToDecimal(conexion.ExecuteScalar(sql));

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

            return(ID_ROTACION_EMPRESA);
        }
Example #24
0
        public Decimal AdicionarMotivo(Decimal ID_MAESTRA_ROTACION, String TITULO, Conexion conexion)
        {
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            Decimal ID_DETALLE_ROTACION = 0;

            sql = "usp_sel_reg_detalle_rotacion_retiro_adicionar ";

            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 nulo\n";
                ejecutar      = false;
            }

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

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

            if (ejecutar)
            {
                try
                {
                    ID_DETALLE_ROTACION = Convert.ToDecimal(conexion.ExecuteScalar(sql));

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

            return(ID_DETALLE_ROTACION);
        }
        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);
        }
Example #26
0
        public Boolean EliminarClase(String ID_CLASE, String USU_MOD)
        {
            Int32   cantidadRegistrosBorrados = 0;
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            tools _tools = new tools();

            sql = "usp_ven_clase_eliminar ";


            if (String.IsNullOrEmpty(ID_CLASE) == false)
            {
                sql         += "'" + ID_CLASE + "'";
                informacion += "ID_CLASE = '" + ID_CLASE + "'";
            }
            else
            {
                MensajError = "El campo ID_DE LA CLASE no puede ser 0\n";
                ejecutar    = false;
            }

            if (ejecutar)
            {
                Conexion conexion = new Conexion(Empresa);
                try
                {
                    cantidadRegistrosBorrados = conexion.ExecuteNonQuery(sql);
                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(USU_MOD, tabla.VEN_CLASE, tabla.ACCION_ELIMINAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    MensajError = e.Message;
                    cantidadRegistrosBorrados = 0;
                }
                finally
                {
                    conexion.Desconectar();
                }
            }

            if (cantidadRegistrosBorrados > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #27
0
        public Boolean ActualizarEntraNominaConRegContratos(Decimal idEmpleado,
                                                            Boolean entraNomina)
        {
            Int32   cantidadRegistrosActualizados = 0;
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            tools _tools = new tools();

            sql = "usp_con_reg_contratos_actualiza_entra_nomina_por_id_empleado ";

            sql += idEmpleado + ", ";

            if (entraNomina == true)
            {
                sql += "'true'";
            }
            else
            {
                sql += "'false'";
            }

            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);
            }
        }
Example #28
0
        public Boolean EliminarUnaCiudadDeLaCoberturaDeCliente(Decimal ID_EMPRESA, String ID_CIUDAD, String USU_ELI, Conexion conexion)
        {
            String  sql                    = null;
            String  informacion            = null;
            Boolean ejecutar               = true;
            Boolean ejecutadoCorrectamente = true;

            sql = "usp_ven_cobertura_eliminar_una_ciudad ";

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

            if (String.IsNullOrEmpty(ID_CIUDAD) == false)
            {
                sql         += "'" + ID_CIUDAD + "'";
                informacion += "ID_EMPRESA = '" + ID_EMPRESA.ToString() + "'";
            }
            else
            {
                MensajeError = "El campo ID_CIUDAD no puede ser VACIO.";
                ejecutar     = false;
            }

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

                    #region auditoria
                    auditoria _auditoria = new auditoria(Empresa);
                    _auditoria.Adicionar(USU_ELI, tabla.VEN_COBERTURA, tabla.ACCION_ELIMINAR, sql, informacion, conexion);
                    #endregion auditoria
                }
                catch (Exception e)
                {
                    ejecutadoCorrectamente = false;
                    throw new Exception("Error originado en logica de negocio(clase:. cobertura metodo:. eliminar): " + e.Message.ToString());
                }
            }
            else
            {
                ejecutadoCorrectamente = false;
            }
            return(ejecutadoCorrectamente);
        }
Example #29
0
 public ActionResult Edit([Bind(Include = "id,accion,fecha,tabla,modificadoPor,idUsuarios,idPadres")] auditoria auditoria)
 {
     if (ModelState.IsValid)
     {
         db.Entry(auditoria).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idUsuarios = new SelectList(db.usuarios, "id", "cedula", auditoria.idUsuarios);
     ViewBag.idPadres   = new SelectList(db.padres, "id", "cedula", auditoria.idPadres);
     return(View(auditoria));
 }
Example #30
0
        public Boolean desactivarBancoEmpresa(Decimal REGISTRO_CON_BANCO_EMPRESA, Conexion conexion)
        {
            Int32   cantidadRegistrosActualizados = 0;
            String  sql         = null;
            String  informacion = null;
            Boolean ejecutar    = true;

            tools _tools = new tools();

            sql = "usp_con_banco_empresa_actualizar_estado ";

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

            sql         += "'N', ";
            informacion += "ACTIVO = 'N', ";

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

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

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