	/** 
	 * Properties
	 */
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN = [];
	
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ID = 0;
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ACC_GROUP_ID = 0;
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_DESCRIPTION = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_MODEL = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_CODE = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_OS = "";
	
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_MACHINE_ID = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_PERMIT_NUMBER = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_DATE_ACCREDITED = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ADDRESS = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_CONTACT = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_TIN = "";
	JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_RESET_COUNT = "";
	
	
	/** 
	 * =======================================================================================================
	 * Perform SQL GET request to the table RECORD_POSDEVICE. Returns DataSet.
	 *
	 * @param VAR_PARAMETER_ARRAY String() Array with Request ParameterSet.
	 * @param CALLBACK_ADDRESS(bool, String) A callback method when the server response is received.
	 *
	 * @param SQL_KEEP_PARAMETER_TO_CACHE bool (Optional) If TRUE save to cache, for easier paging request.
	 * =======================================================================================================
	 */
	JSCUS_SQL._RECORD._POSDEVICE.CUS_ME = function
	(
		CALLBACK_ADDRESS
	)
	{
					
		// Send SQL Request
		// _______________________________________________________________________					
		CUS_SEND_REQUEST
		(
			function (IS_SUCCESS, RESPONSE_STRING)
			{
				// Disable Dialogs
				// _______________________________________________________________________
				CUS_SEND_DIALOG_TRY_DISMISS();
					
				// Validate
				// _______________________________________________________________________
				if(IS_SUCCESS === false)
				{
					console.error("CONNECTION ERROR: \n" + RESPONSE_STRING);
					return;
				}
				
				// Validate JSON Response
				// _______________________________________________________________________
				var JSON_OBJECT = JSRC_JSON.REF_CREATE(RESPONSE_STRING);
				if(JSRC_JSON.REF_IS_SUCCESS(JSON_OBJECT) === false)
				{
					console.error("REQUEST ERROR: \n" + RESPONSE_STRING);
					return;
				}
				
				// JSON Empty (Clears the DataGrodView)
				// _______________________________________________________________________
				if(JSRC_JSON.REF_READ(JSON_OBJECT, "JSON_COUNT") <= 0)
				{
					return;
				}		
				else
				{
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ID = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_ID", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ACC_GROUP_ID = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_ACC_GROUP_ID", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_DESCRIPTION = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_DESCRIPTION", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_MODEL = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_MODEL", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_CODE = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_CODE", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_OS = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_OS", 1);
					
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_MACHINE_ID = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_MACHINE_ID", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_PERMIT_NUMBER = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_PERMIT_NUMBER", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_DATE_ACCREDITED = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_DATE_ACCREDITED", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_ADDRESS = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_ADDRESS", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_CONTACT = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_CONTACT", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_TIN = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_TIN", 1);
					JSCUS_SQL._RECORD._POSDEVICE._LOGIN.REC_POSDEVICE_RESET_COUNT = JSRC_JSON.REF_READ(JSON_OBJECT, "REC_POSDEVICE_RESET_COUNT", 1);			
				}
					
				if(CALLBACK_ADDRESS)	
				{
					CALLBACK_ADDRESS(IS_SUCCESS, RESPONSE_STRING);
				}
			},
			JSCUS_CACHE.SERVER_URL + '/Record/posdevice/me',
			'',
			''
		);	
	}
	
	
	/** 
	 * =======================================================================================================
	 * Perform SQL GET request to the table RECORD_POSDEVICE. Returns DataSet.
	 *
	 * @param VAR_PARAMETER_ARRAY String() Array with Request ParameterSet.
	 * @param CALLBACK_ADDRESS(bool, String) A callback method when the server response is received.
	 *
	 * @param SQL_KEEP_PARAMETER_TO_CACHE bool (Optional) If TRUE save to cache, for easier paging request.
	 * =======================================================================================================
	 */
	JSCUS_SQL._RECORD._POSDEVICE.CUS_LOGIN = function
	(
		VAR_PARAMETER_ARRAY,
		CALLBACK_ADDRESS
	)
	{
		// Parameter Validation
		// _______________________________________________________________________
		JSVC_AV.VAR_VALIDATE_ARGUMENT_TYPE(VAR_PARAMETER_ARRAY, 'VAR_PARAMETER_ARRAY', 'ARRAY');
		
		// Process SQL Request
		// _______________________________________________________________________
		var PARAM_SET = "";			
		PARAM_SET = JSRC_HTTP.REF_ADD(PARAM_SET, 'PARAM_REC_POSDEVICE_MODEL', VAR_PARAMETER_ARRAY["PARAM_REC_POSDEVICE_MODEL"]);
		PARAM_SET = JSRC_HTTP.REF_ADD(PARAM_SET, 'PARAM_REC_POSDEVICE_CODE', VAR_PARAMETER_ARRAY["PARAM_REC_POSDEVICE_CODE"]);
							
		// Send SQL Request
		// _______________________________________________________________________					
		CUS_SEND_REQUEST
		(
			CALLBACK_ADDRESS,
			JSCUS_CACHE.SERVER_URL + '/Record/posdevice/login',
			JSCUS_CACHE.SERVER_URL + '/System/nonce/get',
			PARAM_SET
		);	
	}

	/** 
	 * =======================================================================================================
	 * Populate SP-GET request request parameters with default value.
	 * =======================================================================================================
	 */
	JSCUS_SQL._RECORD._POSDEVICE.CUS_PREPARE_MAPPED_ARRAY_FOR_LOGIN = function()
	{
		// Initialize
		var RESULT_MAPARRAY = [];

		// Populate default fields
		RESULT_MAPARRAY["PARAM_REC_POSDEVICE_MODEL"] = FLAG_NVARCHAR_NULL;
		RESULT_MAPARRAY["PARAM_REC_POSDEVICE_CODE"] = FLAG_NVARCHAR_NULL;

		// Return prepared MapArray
		return RESULT_MAPARRAY;
	}
	
	/** 
	 * =======================================================================================================
	 * Perform SQL SAVE request to the table RECORD_POSDEVICE. Returns DataSet.
	 *
	 * @param VAR_PARAMETER_ARRAY Array with Request ParameterSet.
	 * @param CALLBACK_ADDRESS(bool, String) A callback method when the server response is received.
	 * =======================================================================================================
	 */
	JSCUS_SQL._RECORD._POSDEVICE.CUS_REGISTER = function
	(
		VAR_PARAMETER_ARRAY,
		CALLBACK_ADDRESS
	)
	{
		// Parameter Validation
		// _______________________________________________________________________
		JSVC_AV.VAR_VALIDATE_ARGUMENT_TYPE(VAR_PARAMETER_ARRAY, 'VAR_PARAMETER_ARRAY', 'ARRAY');
		
		// Process SQL Request
		// _______________________________________________________________________
		var PARAM_SET = "";	
	
		PARAM_SET = JSRC_HTTP.REF_ADD(PARAM_SET, 'PARAM_REC_POSDEVICE_DESCRIPTION',  VAR_PARAMETER_ARRAY["PARAM_REC_POSDEVICE_DESCRIPTION"]);
		PARAM_SET = JSRC_HTTP.REF_ADD(PARAM_SET, 'PARAM_REC_POSDEVICE_MODEL',  VAR_PARAMETER_ARRAY["PARAM_REC_POSDEVICE_MODEL"]);
		PARAM_SET = JSRC_HTTP.REF_ADD(PARAM_SET, 'PARAM_REC_POSDEVICE_CODE',  VAR_PARAMETER_ARRAY["PARAM_REC_POSDEVICE_CODE"]);
		PARAM_SET = JSRC_HTTP.REF_ADD(PARAM_SET, 'PARAM_REC_POSDEVICE_OS',  VAR_PARAMETER_ARRAY["PARAM_REC_POSDEVICE_OS"]);

		// Send SQL Request
		// _______________________________________________________________________		
		CUS_SEND_REQUEST
		(
			CALLBACK_ADDRESS,
			JSCUS_CACHE.SERVER_URL + '/Record/posdevice/register',
			JSCUS_CACHE.SERVER_URL + '/System/nonce/get',
			PARAM_SET
		);	
	}
	
	/** 
	 * =======================================================================================================
	 * Populate SP-SAVE request parameters with default value.
	 * =======================================================================================================
	 */
	JSCUS_SQL._RECORD._POSDEVICE.CUS_PREPARE_MAPPED_ARRAY_FOR_REGISTER = function()
	{
		// Initialize
		var RESULT_MAPARRAY = [];

		// Populate default fields
		RESULT_MAPARRAY["PARAM_REC_POSDEVICE_DESCRIPTION"] = FLAG_NVARCHAR_NULL;
		RESULT_MAPARRAY["PARAM_REC_POSDEVICE_MODEL"] = FLAG_NVARCHAR_NULL;
		RESULT_MAPARRAY["PARAM_REC_POSDEVICE_CODE"] = FLAG_NVARCHAR_NULL;
		RESULT_MAPARRAY["PARAM_REC_POSDEVICE_OS"] = FLAG_NVARCHAR_NULL;
		
		// Return prepared MapArray
		return RESULT_MAPARRAY;		
	}
	
	
	JSCUS_SQL._RECORD._POSDEVICE.CUS_ME();
	