﻿function USER(args){
    
        this.IsEmpty = true;
        this.UserId = '';
        this.UserName = '';
        this.Type = '';
        this.RealName = '';
        this.Initial =  '';
        this.Avatar = '';
        this.Male = '';
        this.BirthYear = '';
        this.Location = '';
        
    if(args != null){
        this.IsEmpty = false;
        this.UserId = (typeof(args['userId']) == 'undefined' || args['userId'] == null) ? '': args['userId'];
        this.UserName = (typeof(args['userName']) == 'undefined' || args['userName'] == null) ? '': args['userName'];
        this.RealName = (typeof(args['realName']) == 'undefined' || args['type'] == null) ? '' : args['realName'];
        this.Initial = (typeof(args['initial']) == 'undefined' || args['initial'] == null) ? '' : args['initial'];
        this.Avatar = (typeof(args['avatar']) == 'undefined' || args['avatar'] == null) ? '' : args['avatar'];
        this.Location = (typeof(args['location']) == 'undefined' || args['location'] == null) ? '' : args['location'];
        this.BirthYear = (typeof(args['birthYear']) == 'undefined' || args['birthYear'] == null) ? 0 : args['birthYear'];
        this.Type = (typeof(args['type']) == 'undefined' || args['type'] == null) ? 0 : args['type'];
        this.Male = (typeof(args['male']) == 'undefined' || args['male'] == null) ? 1 : args['male'];
    }
    
}

USER.prototype = {
    Show:function(){
        alert('UserName:'+this.UserName + '\nRealName:' + this.Initial+' ' +this.RealName + '\nType:'+this.Type + '\nUserID:'+this.UserId);
    }    
}


