ciao a tutti
Ho questa classe:
public class Corriere
{
struct tipoCampo
{
public string Valore;
internal string Campo;
}
public Corriere()
{
DestinatarioRagioneSociale = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABRSD
};
DestinatarioIndirizzo = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABIND
};
DestinatarioCap = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABCAD
};
DestinatarioLocalita = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABLOD
};
DestinatarioProvincia = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABPRD
};
DestinatarioNazione = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABNZD
};
Peso = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABPKB
};
ValoreMerceDichiarato = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABVMD
};
ValoreMerceDichiaratoDivisa = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABVAD
};
DestinatarioReferente = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABNRC
};
DestinatarioTelefono = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABTRC
};
DestinatarioMail = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABEMD
};
DestinatarioCellulare = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABCEL
};
Note = new tipoCampo
{
Valore = string.Empty,
Campo = BRT.VABNOT
};
}
public tipoCampo DestinatarioRagioneSociale
{
get;
set;
}
public tipoCampo DestinatarioIndirizzo
{
get;
set;
}
public tipoCampo DestinatarioCap
{
get;
set;
}
public tipoCampo DestinatarioLocalita
{
get;
set;
}
public tipoCampo DestinatarioProvincia
{
get;
set;
}
public tipoCampo DestinatarioNazione
{
get;
set;
}
public tipoCampo DestinatarioReferente
{
get;
set;
}
public tipoCampo DestinatarioTelefono
{
get;
set;
}
public tipoCampo DestinatarioMail
{
get;
set;
}
public tipoCampo DestinatarioCellulare
{
get;
set;
}
public tipoCampo Note
{
get;
set;
}
public tipoCampo Peso
{
get;
set;
}
public tipoCampo ValoreMerceDichiarato
{
get;
set;
}
public tipoCampo ValoreMerceDichiaratoDivisa
{
get;
set;
}
}
Ho un vettore con i valori: VABIND, VABNZD, ecc
E una lista List<Corriere>
Voglio eseguire un ciclo su tutti i valori contenuti nel vettore e, dato un elemento della lista, recuperare il valore del campo 'Valore' che ha come valore del campo 'Campo' l'elemento del vettore che sto considerando.
Es. sto considerando 'VABIND' e voglio come risultato il valore di DestinatarioIndirizzo.Valore
Come posso fare?
Grazie mille