package net.fdms.Database 
{
	import net.fdms.Function.Convert.XMLtoOBJECT;
	/**
	 * 2011/5/13 9:56
	 * @author Dawnboy
	 */
	public class MarryInfo 
	{
		/**
		 * 获取结婚信息 
		 */
		private static var _marryInfo:Object = {};
		
		public function MarryInfo() 
		{
			/**
			<home>
				<face url="aaa.jpg"></face>
				<husband birthday="2011-01-01" address="" name="郭靖">
					<![CDATA[婚姻誓言]]>
				</husband>
				<wife birthday="2011-01-01" address="" name="黄蓉">
					<![CDATA[婚姻誓言]]>
				</wife>
			</home>
			**/
		}
		
		/**
		 * 初始化结婚信息数据
		 * @param	infoSets
		 */
		public static function init(infoSets:XMLList):void {
			_marryInfo.husbandInfo = (infoSets.husband != XMLList(undefined))?XMLtoOBJECT.convert(infoSets.husband):{};	//丈夫信息
			_marryInfo.wifeInfo = (infoSets.wife != XMLList(undefined))?XMLtoOBJECT.convert(infoSets.wife): { };	//妻子信息
			_marryInfo.photo = (infoSets.face != XMLList(undefined) && infoSets.face.@url != "")?String(infoSets.face.@url):null;		//客厅照片
			//trace("接收夫妻信息:\n    丈夫:" + _marryInfo.husbandInfo.name + "\n    妻子:" + _marryInfo.wifeInfo.name + "\n    照片:" + _marryInfo.photo + "\n---------------------------------");
		}
		
		/**
		 * 获取丈夫信息
		 * @return
		 */
		public static function getHusbandInfo():Object {
			return _marryInfo.husbandInfo;
		}
		
		/**
		 * 获取妻子信息
		 * @return
		 */
		public static function getWifeInfo():Object {
			return _marryInfo.wifeInfo;
		}
		
		public static function getIndexPhoto():String {
			return _marryInfo.photo;
		}
		
	}

}