Esempio n. 1
0
        public string CreaParteData()
        {
            string parteData;

            char[] codMese = new char[] { 'A', 'B', 'C', 'D', 'E', 'H', 'L', 'M', 'P', 'R', 'S', 'T' };
            byte   indMese;
            byte   indGiorno;

            indMese   = byte.Parse(DataNascita.ToString("MM"));
            indGiorno = byte.Parse(DataNascita.ToString("dd"));

            if (this.Sesso == 'F')
            {
                indGiorno += 40;
            }

            parteData = DataNascita.ToString("yy") + codMese[indMese - 1] + indGiorno.ToString().PadLeft(2, '0');

            return(parteData);
        }
Esempio n. 2
0
 //metodo
 public virtual string PersonString()
 {
     return("Nome: " + Nome + " " + "Cognome: " + Cognome + " " + "Data di nascita: " + DataNascita.ToShortDateString() + " " + "Eta: " + Eta + " ");
 }
Esempio n. 3
0
        public override string ToString()
        {
            string isDead = !isAlive?string.Concat(" - ", DataMorte, ", ", LuogoMorte) : "";

            return(string.Concat(Iniziali, ".", Cognome, "(", DataNascita.ToString("MMMM dd, yyyy"), ", ", LuogoNascita, isDead, ")"));// si usa la , al posto del +
        }
Esempio n. 4
0
 public override int GetHashCode()
 {
     return(Nome.GetHashCode() ^ Cognome.GetHashCode() ^ Cf.GetHashCode() ^ DataNascita.GetHashCode() ^
            LuogoNascita.GetHashCode() ^ Residenza.GetHashCode() ^ DataAssunzione.GetHashCode() ^ Qualifica.GetHashCode());
 }