Ejemplo n.º 1
0
        public E_PAR_TIP_CARACTER Obtener_PAR_TIP_CARACTER(string PAR_TIP_CARACTER_TYP)
        {
            ConexionBD                Conexion = new ConexionBD();
            SqlDataReader             LeerFilas;
            List <E_PAR_TIP_CARACTER> Lista   = new List <E_PAR_TIP_CARACTER>();
            SqlCommand                Comando = new SqlCommand();

            try
            {
                Comando.Connection  = Conexion.AbrirConexion();
                Comando.CommandText = "P_GET_PAR_TIP_CARACTER";
                Comando.Parameters.AddWithValue("@PAR_TIP_CARACTER_TYP", PAR_TIP_CARACTER_TYP);
                Comando.CommandType = CommandType.StoredProcedure;

                LeerFilas = Comando.ExecuteReader();

                while (LeerFilas.Read())
                {
                    E_PAR_TIP_CARACTER rsp = new E_PAR_TIP_CARACTER();
                    rsp.PAR_TIP_CARACTER_COD = Convert.ToString(LeerFilas["PAR_TIP_CARACTER_COD"]);

                    rsp.PAR_TIP_CARACTER_ORIGINAL  = Convert.ToString(LeerFilas["PAR_TIP_CARACTER_ORIGINAL"]);
                    rsp.PAR_TIP_CARACTER_REEMPLAZO = Convert.ToString(LeerFilas["PAR_TIP_CARACTER_REEMPLAZO"]);
                    rsp.PAR_TIP_CARACTER_EST       = Convert.ToString(LeerFilas["PAR_TIP_CARACTER_EST"]);

                    Lista.Add(rsp);
                }
                LeerFilas.Close();
                Conexion.CerrarConecion();
            }
            catch (Exception e)
            {
                Conexion.CerrarConecion();
            }

            return(Lista[0]);
        }
Ejemplo n.º 2
0
        /*OBTENER TODOS LOS TIPOS DE CARACTERES CON ESTADO ACTIVO*/
        public List <E_PAR_TIP_CARACTER> ObtenerTipCaracter()
        {
            ConexionBD                Conexion = new ConexionBD();
            SqlDataReader             LeerFilas;
            DataTable                 tabla   = new DataTable();
            List <E_PAR_TIP_CARACTER> Lista   = new List <E_PAR_TIP_CARACTER>();
            SqlCommand                Comando = new SqlCommand();


            try
            {
                Comando.Connection  = Conexion.AbrirConexion();
                Comando.CommandText = "P_GET_PAR_TIP_CARACTER";

                Comando.CommandType = CommandType.StoredProcedure;
                LeerFilas           = Comando.ExecuteReader();
                tabla.Load(LeerFilas);
                foreach (DataRow row in tabla.Rows)
                {
                    E_PAR_TIP_CARACTER peticion = new E_PAR_TIP_CARACTER();

                    peticion.PAR_TIP_CARACTER_ORIGINAL  = row["PAR_TIP_CARACTER_ORIGINAL"].ToString();
                    peticion.PAR_TIP_CARACTER_REEMPLAZO = row["PAR_TIP_CARACTER_REEMPLAZO"].ToString();

                    Lista.Add(peticion);
                }

                LeerFilas.Close();
                Conexion.CerrarConecion();
            }
            catch (Exception e)
            {
                Conexion.CerrarConecion();
            }
            return(Lista);
        }