/*-----------------------------------------------------------------------------
	Name: A01_MPD_008_GenPg_Refresh.c
	Recorded By: Converted via tool
	Date of recording:
	Flow details:
	Build details:
	Modification History:
-----------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ns_string.h"

void A01_MPD_008_GenPg_Refresh()
{
	

	/* clk refresh button */

	
	
	
	ns_start_transaction("A01_AZ_014_MPD_General_clkRefresh");

	//addDynaTraceHeader("NA=A01_AZ_014_MPD_General_clkRefresh;PC=flow_17");
	ns_web_url("General_ClickRefresh",
		"URL={P_URL}/aaa-app/flow?_flowId=quote-main-flow&_flowExecutionKey=e4s1&_windowId={C_windowID}", 
		"Method=POST", 
		"HEADER=Content-Type:application/x-www-form-urlencoded",
		//"HEADER=Faces-Request:partial/ajax",
		"HEADER=Origin:https://e3.pncie.com",
		"HEADER=Referer: {P_URL}/aaa-app/flow?_flowId=quote-main-flow&_flowExecutionKey=e4s1&_windowId={C_windowID}", 
		"Snapshot=t21.inf", 
		ITEMDATA, 
		"Name=policyDataGatherForm:j_id__v_2_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_3_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_4_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAFirstNamedInsured_fni", "Value={C_AAA1stNmdInsrd}",  
		"Name=policyDataGatherForm:j_id__v_5_bls-input", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_titleCd", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_firstName", "Value={P_clkFname}",  
		"Name=policyDataGatherForm:insuredInformation_middleName", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_lastName", "Value={P_clkLname}",  
		"Name=policyDataGatherForm:insuredInformation_suffix", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_legalIdentification", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_dateOfBirthInputDate", "Value={P_clkDOB}",  
		"Name=policyDataGatherForm:insuredInformation_dateOfBirthInputCurrentDate", "Value={C_DOBInpCurrDate}",  
		"Name=policyDataGatherForm:insuredInformation_insuredBaseDtInputDate", "Value={C_InsrdBaseDate}",  
		"Name=policyDataGatherForm:insuredInformation_insuredBaseDtInputCurrentDate", "Value={C_InsuredInputCurrentDate}",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_postalCode", "Value={P_AddressValidation_Final}",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_addressLine1", "Value={C_AddressLine1}",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_addressLine2", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_city", "Value={C_City}",  
		"Name=policyDataGatherForm:insuredInformation_primaryAddress_address_stateProvCd", "Value=AZ",  
		"Name=policyDataGatherForm:insuredInformation_priorAddress_address_stateProvCd", "Value=",  
		"Name=policyDataGatherForm:insuredInformation_differentAddressInd", "Value=false",  
		"Name=policyDataGatherForm:insuredInformation_secondaryAddress_address_stateProvCd", "Value=AZ",  
		"Name=policyDataGatherForm:insuredInformation_residentTypeCd", "Value=",  
		"Name=policyDataGatherForm:primaryAddressStandartized", "Value=true",  
		"Name=policyDataGatherForm:secondaryAddressStandartized", "Value=",  
		"Name=policyDataGatherForm:j_id__v_6_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_7_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_8_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_9_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_10_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_ExistingPolicies_existingMembershipCd", "Value=Yes",  
		"Name=policyDataGatherForm:sedit_ExistingPolicies_overrideTypeCd", "Value=Term",  
		"Name=policyDataGatherForm:sedit_ExistingPolicies_membershipNumber", "Value=",  
		"Name=policyDataGatherForm:refreshMPD", "Value=Refresh",  
		"Name=policyDataGatherForm:j_id__v_11_bls-input", "Value=",  
		"Name=policyDataGatherForm:contactInformation_phoneNum1", "Value=",  
		"Name=policyDataGatherForm:contactInformation_phoneNum2", "Value=",  
		"Name=policyDataGatherForm:contactInformation_phoneNum3", "Value=",  
		"Name=policyDataGatherForm:contactInformation_preferredPhone", "Value=",  
		"Name=policyDataGatherForm:contactInformation_email", "Value=",  
		"Name=policyDataGatherForm:j_id__v_12_bls-input", "Value=",  
		"Name=policyDataGatherForm:currentCarrierInformation_overridePrefilledCarrier", "Value=false",  
		"Name=policyDataGatherForm:currentCarrierInformation_continuousMonthsInsured", "Value=false",  
		"Name=policyDataGatherForm:currentCarrierInformation_agentEnteredCarrier", "Value=",  
		"Name=policyDataGatherForm:currentCarrierInformation_enteredPriorBILimits", "Value=",  
		"Name=policyDataGatherForm:j_id__v_13_bls-input", "Value=",  
		"Name=policyDataGatherForm:PolicyComponentIdHolder", "Value=Policy",  
		"Name=policyDataGatherForm:j_id__v_14_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_Policy_imported", "Value=NEW",  
		"Name=policyDataGatherForm:sedit_Policy_aaaProgramCode", "Value=NewRenPAS",  
		"Name=policyDataGatherForm:sedit_Policy_policyDetail_typeOfPolicyCd", "Value=STD",  
		"Name=policyDataGatherForm:sedit_Policy_contractTerm_effectiveInputDate", "Value={C_InsrdBaseDate}",  
		"Name=policyDataGatherForm:sedit_Policy_contractTerm_effectiveInputCurrentDate", "Value={C_InsuredInputCurrentDate}",  
		"Name=policyDataGatherForm:sedit_Policy_contractDisplay", "Value=12",  
		"Name=policyDataGatherForm:sedit_Policy_contractTerm_expirationInputCurrentDate", "Value={C_InsuredExpCurrentDate}",  
		"Name=policyDataGatherForm:sedit_Policy_adverselyImpacted", "Value=",  
		"Name=policyDataGatherForm:j_id__v_15_bls-input", "Value=",  
		"Name=policyDataGatherForm:asdOverrideInfo_overrideAsdLevel", "Value=false",  
		"Name=policyDataGatherForm:asdOverrideInfo_asdOverrideLevel", "Value=",  
		"Name=policyDataGatherForm:j_id__v_16_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_officeType", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_agencyCd", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_salesChannelType", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_agencyLocation", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_agentType", "Value=AGENT",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_agentCd", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_everEnrolledInEvalue", "Value=false",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_commissionTypeCd", "Value=NB",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_authorizedBy", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAProducerInfo_tollNumberCd", "Value=",  
		"Name=policyDataGatherForm:j_id__v_17_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_18_bls-input", "Value=",  
		"Name=policyDataGatherForm:sedit_AAAPolicyInfo_leadSourceCd", "Value=",  
		"Name=policyDataGatherForm:j_id__v_19_bls-input", "Value=",  
		"Name=policyDataGatherForm:printingInfo_suppressPrint", "Value=PD",  
		"Name=policyDataGatherForm:j_id__v_20_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_21_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_22_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_23_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_24_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_25_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_26_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_27_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_28_bls-input", "Value=",  
		"Name=policyDataGatherForm:j_id__v_29_bls-input", "Value=",  
		"Name=policyDataGatherForm:currentPFElmentFocus", "Value=",  
		"Name=policyDataGatherForm:rulesValidationSubmit", "Value=true",  
		"Name=policyDataGatherForm:focusFirstInputElement", "Value=",  
		"Name=policyDataGatherForm:focusFirstInputForInstance", "Value=",  
		"Name=policyDataGatherForm:instanceToEliminate", "Value=",  
		"Name=policyDataGatherForm:focusControlAfterPopupClose", "Value=",  
		"Name=policyDataGatherForm_SUBMIT", "Value=1",  
		"Name=javax.faces.ViewState", "Value={C_VSPrefillPage}",  
		ITEMDATA_END
		);
	 //ns_end_transaction("A01_AZ_014_MPD_General_clkRefresh", NS_AUTO_STATUS);

if(atoi(ns_eval_string("{AddSuccessCount}"))>0){

			ns_end_transaction("A01_AZ_014_MPD_General_clkRefresh", NS_SUCCESS_STATUS);

			printf( " User: [%s] has Scuccessfully Searched and retrieved ",ns_eval_string("{P_Username}"));
			printf( " Other AAA OWned Policy: [%s]",ns_eval_string("{P_clkPolNum}"));
			printf( " for Customer with First Name: [%s] & ",ns_eval_string("{P_clkFname}"));
			printf( " Last Name: [%s] on ",ns_eval_string("{P_clkLname}"));
			printf( " URL: [%s] ",ns_eval_string("{P_URL}"));
			
	}else{
		ns_end_transaction("A01_AZ_014_MPD_General_clkRefresh", NS_SUCCESS_STATUS);

			printf( " User: [%s] has failed for retrieving ",ns_eval_string("{P_Username}"));
			printf( " Other AAA OWned Policy: [%s]",ns_eval_string("{P_clkPolNum}"));
			printf( " for Customer with First Name: [%s] & ",ns_eval_string("{P_clkFname}"));
			printf( " Last Name: [%s] on ",ns_eval_string("{P_clkLname}"));
			printf( " URL: [%s] ",ns_eval_string("{P_URL}"));
						
						ns_exit_session();
}

}
