﻿function jPax()
{
    var This = this;
    this.codPax = null;
    this.dataNascimento = null;
    this.IDgrupo = null;
    this.nome = null;
    this.sexoPax = "M";
    this.sobreNome = null;
    this.tipoPax = null;
    
    this.setIdade = function(pIdade){
        this.dataNascimento = Date.now().addYears(pIdade*-1);
    };
    this.getIdade = function(){
        try
        {
            var anoNasc = parseInt(This.dataNascimento.toString('yyyy'));
            var anoAtual = parseInt(Date.now().toString('yyyy'));
            return anoAtual-anoNasc;
        }
        catch(e)
        {
            return 0;
        };
    };    
    this.constructor = new function(){};
};
