<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"  backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#BF5DC5, #010708]" verticalAlign="middle">
	
	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;
			import mx.rpc.events.FaultEvent;
			import mx.rpc.events.ResultEvent;
			
			[Bindable]
			private var result:String=new String;
			
			 public function init():void
            {
            	result= HolidayTripWebService.InsertUser(Fname.text,Lname.text,radiogroup1.selectedValue,Age.text,Padd.text,Cadd.text,Email.text,Phn.text,Mob.text,Uname.text,Pwd.text);
            	if(result=="True")
            	{
            	var url:URLRequest = new URLRequest("Login.mxml");
				navigateToURL(url,"_self");
            	}
            	else
            	if(result=="False")
            	{
            	Alert.show("Insertion Failed...");
            	}
            }
	
			public function getreg(event:ResultEvent):void
		{
			
		}
		public function Error(event:FaultEvent):void
		{
			Alert.show("Error in Login");
		}
		
		public function Home():void
	{
		var url:URLRequest=new URLRequest("Home.html");
			navigateToURL(url,"_self");
	}
	
	
		]]>
	</mx:Script>
	
	<mx:WebService
		id="HolidayTripWebService" 
		wsdl="http://localhost:50854/HTWS/Service.asmx?wsdl"
		showBusyCursor="true">
		<mx:operation name="InsertUser" resultFormat="object" result="getreg(event)">
        </mx:operation>		
	</mx:WebService>
	
	
	<mx:Label x="290" y="10" text="Registration" fontFamily="Courier New" fontSize="25" fontWeight="bold" fontStyle="italic" color="#2AC85B" height="32"/>
	<mx:Form x="105.5" y="50" width="484" height="441">
	<mx:FormItem label="First Name:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextInput id="Fname" color="#22230F"/>		
	</mx:FormItem>
	<mx:FormItem label="Last Name:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextInput id="Lname" color="#22230F"/>		
	</mx:FormItem>
	<mx:FormItem label="Gender:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:HBox width="170">
			<mx:RadioButtonGroup id="radiogroup1"/>
			<mx:RadioButton label="Male" groupName="radiogroup1"/>
			<mx:RadioButton label="Female" groupName="radiogroup1"/>
		</mx:HBox>
				
	</mx:FormItem>
	<mx:FormItem label="Age:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextInput id="Age" color="#22230F"/>
	</mx:FormItem>
	<mx:FormItem label="Permanent Address:" width="383" height="51" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextArea id="Padd" color="#22230F"/>
	</mx:FormItem>
	<mx:FormItem label="Current Address:" width="383" height="51" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextArea id="Cadd" color="#22230F"/>
	</mx:FormItem>
	<mx:FormItem label="Email Id:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextInput id="Email" color="#22230F"/>		
	</mx:FormItem>
	<mx:FormItem label="Phone:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextInput id="Phn" color="#22230F"/>		
	</mx:FormItem>
	<mx:FormItem label="Mobile No:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextInput id="Mob" color="#22230F"/>		
	</mx:FormItem>
	<mx:FormItem label="User Name:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextInput id="Uname" color="#22230F"/>		
	</mx:FormItem>
	<mx:FormItem label="Password:" width="383" height="27" horizontalAlign="center" fontFamily="Courier New" fontSize="13" fontWeight="bold" fontStyle="italic" color="#DEE60E">
		<mx:TextInput id="Pwd" color="#22230F"/>		
	</mx:FormItem>
	</mx:Form>
	<mx:Button x="301" y="535" label="Submit" width="80" height="27" borderColor="#259DF1" fillAlphas="[1.0, 1.0]" fillColors="[#D62F2F, #190606]" color="#B6D2D8" cornerRadius="20" id="sub" click="init()"/>
	<mx:LinkButton x="661" y="28" label="Home" cornerRadius="20" themeColor="#ECF0F3" click="Home()"/>

	
</mx:Application>
	