Esempio n. 1
0
        public List <ENCIIUEspecifica> ObtenerTodosEspecifica(string codGrupo)
        {
            DbCommand oCommand             = null /* TODO Change to default(_) if this is not a reference type */;
            List <ENCIIUEspecifica> oLista = new List <ENCIIUEspecifica>();

            try
            {
                oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_SCTR_CIIU_sel");
                GenericDataAccess.AgregarParametro(oCommand, "@argTipo", "2", TipoParametro.STR, Direccion.INPUT);
                GenericDataAccess.AgregarParametro(oCommand, "@argCodGrupo", codGrupo, TipoParametro.STR, Direccion.INPUT);
                GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT);
                DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand);
                while (oDataReader.Read())
                {
                    ENCIIUEspecifica oENLista = new ENCIIUEspecifica();
                    oENLista.CodigoCIIU      = oDataReader["CodigoCIIU"].ToString();
                    oENLista.DescripcionCIIU = oDataReader["DescripcionCIIU"].ToString();
                    oLista.Add(oENLista);
                }
                return(oLista);
            }
            catch (Exception ex)
            {
                throw new Exception();
            }
            finally
            {
                GenericDataAccess.CerrarConexion(oCommand, null /* TODO Change to default(_) if this is not a reference type */);
            }
        }
Esempio n. 2
0
        public ENCIIUEspecifica ObtenerEspecificaUno(string CodigoGrupoCIUU, string CodigoCIUU)

        {
            DbCommand        oCommand          = null;
            ENCIIUEspecifica oENCIIUEspecifica = new ENCIIUEspecifica();

            try
            {
                oCommand = GenericDataAccess.CreateCommand(dataProviderName, connectionString, "usp_SCTR_Ubigeo_sel_uno");
                GenericDataAccess.AgregarParametro(oCommand, "@argTipo", "2", TipoParametro.STR, Direccion.INPUT);
                GenericDataAccess.AgregarParametro(oCommand, "@argCodGrupo", CodigoGrupoCIUU, TipoParametro.STR, Direccion.INPUT);
                GenericDataAccess.AgregarParametro(oCommand, "@argCodCIIU", CodigoCIUU, TipoParametro.STR, Direccion.INPUT);
                GenericDataAccess.AgregarParametro(oCommand, "@argErrorCode", 1, TipoParametro.INT, Direccion.OUTPUT);
                DbDataReader oDataReader = GenericDataAccess.ExecuteReader(oCommand);
                while (oDataReader.Read())
                {
                    oENCIIUEspecifica.CodigoCIIU      = oDataReader["CodigoCIIU"].ToString();
                    oENCIIUEspecifica.DescripcionCIIU = oDataReader["DescripcionCIIU"].ToString();
                }
                return(oENCIIUEspecifica);
            }
            catch (Exception ex)
            {
                throw new Exception();
            }
            finally
            {
                GenericDataAccess.CerrarConexion(oCommand, null);
            }
        }