public string get_pais()
        {
            DAOPais dao  = new DAOPais();
            Pais    pais = dao.retrieveBy_id(this.nacionalidad);

            return(pais.descripcion);
        }
Exemple #2
0
        public Cuenta initialize(DataRow _dr)
        {
            dr = _dr;
            DataColumnCollection dcc = dr.Table.Columns;

            if (dcc.Contains("id"))
            {
                id = (dr["id"] == DBNull.Value) ? null : (long?)Convert.ToInt64(dr["id"]);
            }
            if (dcc.Contains("num_cuenta"))
            {
                numCuenta = (dr["num_cuenta"] == DBNull.Value) ? null : (long?)Convert.ToInt64(dr["num_cuenta"]);
            }
            if (dcc.Contains("fecha_creacion"))
            {
                fechaCreacion = (dr["fecha_creacion"] == DBNull.Value) ? (DateTime?)null : Convert.ToDateTime(dr["fecha_creacion"]);
            }
            if (dcc.Contains("estado"))
            {
                estado = (dr["estado"] == DBNull.Value) ? null : (int?)Convert.ToInt32(dr["estado"]);
            }
            if (dcc.Contains("pais"))
            {
                pais = (dr["pais"] == DBNull.Value) ? null : (int?)Convert.ToInt32(dr["pais"]);
            }
            if (dcc.Contains("fecha_cierre"))
            {
                fechaCierre = (dr["fecha_cierre"] == DBNull.Value) ? (DateTime?)null : Convert.ToDateTime(dr["fecha_cierre"]);
            }
            if (dcc.Contains("saldo"))
            {
                saldo = Convert.ToDouble(dr["saldo"]);
            }
            if (dcc.Contains("tipo_moneda"))
            {
                tipoMoneda = (dr["tipo_moneda"] == DBNull.Value) ? null : (int?)Convert.ToInt32(dr["tipo_moneda"]);
            }
            if (dcc.Contains("tipo_cuenta"))
            {
                tipoCuenta = (dr["tipo_cuenta"] == DBNull.Value) ? null : (int?)Convert.ToInt32(dr["tipo_cuenta"]);
            }
            if (dcc.Contains("cod_cli"))
            {
                codigoCliente = (dr["cod_cli"] == DBNull.Value) ? null : (int?)Convert.ToInt32(dr["cod_cli"]);
            }
            // Buscar y componer banco y país para tenerlos a mano
            DAOPais daoPais = new DAOPais();

            cPais = daoPais.retrieveBy_id(pais);
            return(this);
        }