// ************************************************************************************
// User
// ************************************************************************************
// namespace
Type.registerNamespace("Competir.MiEmpresa.Security");

// User
Competir.MiEmpresa.Security.User = function(generic)
{
	Competir.MiEmpresa.Security.User.initializeBase(this);
	this._FKInstancia = 0;
	this._Username = "";
	this._Email = "";
	this._FirstName = "";
	this._LastName = "";
	this._GUID = "";
	this._AccessExpirationDate = "";
	this._UserType = null;
	this._EffectiveLicenseType = null;
	this._RelatedUsers = null;
	if (generic)
	{
		this.parseGeneric(generic);
	}
};

// prototype
Competir.MiEmpresa.Security.User.prototype =
{
	// methods
	parseGeneric: function(obj)
	{
		if (String.isInstanceOfType(obj))
		{
			obj = Sys.Serialization.JavaScriptSerializer.deserialize(obj);
		}
		this.set_FKInstancia(obj.FKInstancia);
		this.set_Username(obj.Usuario);
		this.set_Email(obj.Email);
		this.set_FirstName(obj.Nombre);
		this.set_LastName(obj.Apellido);
		this.set_GUID(obj.GUID);
		this.set_AccessExpirationDate(obj.AccessExpirationDate);
		this.set_UserType(obj.UserType);
		this.set_EffectiveLicenseType(obj.EffectiveLicenseType);
		this.set_RelatedUsers(obj.RelatedUsers);
		obj = null;
	},

	// properties
	get_FKInstancia: function()
	{
		return this._FKInstancia;
	},
	set_FKInstancia: function(value)
	{
		if (this._FKInstancia !== value)
		{
			this._FKInstancia = value;
			this.raisePropertyChanged("FKInstancia");
		}
	},
	get_Username: function()
	{
		return this._Username;
	},
	set_Username: function(value)
	{
		if (this._Username !== value)
		{
			this._Username = value;
			this.raisePropertyChanged("Username");
		}
	},
	get_GUID: function()
	{
		return this._GUID;
	},
	set_GUID: function(value)
	{
		if (this._GUID !== value)
		{
			this._GUID = value;
			this.raisePropertyChanged("GUID");
		}
	},
	get_AccessExpirationDate: function()
	{
		return this._AccessExpirationDate;
	},
	set_AccessExpirationDate: function(value)
	{
		if (this._AccessExpirationDate !== value)
		{
			this._AccessExpirationDate = value;
			this.raisePropertyChanged("AccessExpirationDate");
		}
	},
	get_UserType: function()
	{
		return this._UserType;
	},
	set_UserType: function(value)
	{
		if (this._UserType !== value)
		{
			this._UserType = value;
			this.raisePropertyChanged("UserType");
		}
	},
	get_EffectiveLicenseType: function()
	{
		return this._EffectiveLicenseType;
	},
	set_EffectiveLicenseType: function(value)
	{
		if (this._EffectiveLicenseType !== value)
		{
			this._EffectiveLicenseType = value;
			this.raisePropertyChanged("EffectiveLicenseType");
		}
	},
	get_RelatedUsers: function()
	{
		return this._RelatedUsers;
	},
	set_RelatedUsers: function(value)
	{
		if (this._RelatedUsers !== value)
		{
			this._RelatedUsers = value;
			this.raisePropertyChanged("RelatedUsers");
		}
	},
	get_FirstName: function()
	{
		return this._FirstName;
	},
	set_FirstName: function(value)
	{
		if (this._FirstName !== value)
		{
			this._FirstName = value;
			this.raisePropertyChanged("FirstName");
		}
	},
	get_LastName: function()
	{
		return this._LastName;
	},
	set_LastName: function(value)
	{
		if (this._LastName !== value)
		{
			this._LastName = value;
			this.raisePropertyChanged("LastName");
		}
	},
	get_Email: function()
	{
		return this._Email;
	},
	set_Email: function(value)
	{
		if (this._Email !== value)
		{
			this._Email = value;
			this.raisePropertyChanged("Email");
		}
	}
};

// registration
Competir.MiEmpresa.Security.User.registerClass("Competir.MiEmpresa.Security.User", Sys.Component);