• Arpitha M
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hi ,

I am getting a parsing error at line which is bold and underlined.
While I am reading today's date.
Please help me out to resolve this problem.

import { LightningElement, track,wire } from 'lwc';
import { getPicklistValues, getPicklistValuesByRecordType } from 'lightning/uiObjectInfoApi';
import { getObjectInfo } from 'lightning/uiObjectInfoApi';
import HOTEL_OBJECT from '@salesforce/schema/Hotel_Information__c';
import searchroom from '@salesforce/apex/RoomSearch_ctrl.searchroom';
import addtocart from '@salesforce/apex/AddToCart_ctrl.addToCart';

export default class ButtonGroupBasic extends LightningElement {
    @track tdate;
    @track dd;
    @track mm;
    @track yyyy;
   
    @track inputvalue;
    @track Buttontrue=true;
    @track date1;
    zone;
    state;
    bookeremail;
    hotelid;
    checkindate;
    checkoutdate;
    @track value;
    @track id;
    @track roomTypeList;
    @track controllingValues = []; // Zone values
    @track dependentValues = [];   // state values
    @track hotelvalues= []; // Hotel values
    @track selectedZone;
    @track selectedState;
    @track selectedHotel;
    @track isEmpty = false;
    @track error;
    controlValues;
    controlValues2;
    totalDependentValues = []; // dependent state values
    totalDepHotelValues=[];    // dependent hotel values
    @track loaded= true;
    
    dd = new Date().getDate();
    mm = new Date().getMonth() + 1;
    yyyy = new Date().getFullYear();
    
    if(dd < 10){
         dd = '0'+dd;
    }
    if(mm < 10){
         mm = '0'+mm;
    }
    tdate = this.yyyy+'-'+this.mm+'-'+this.dd;
    //console.log("date"+tdate);
    handleChange(event){
        this.inputvalue = event.target.value;
        console.log('++++',this.inputvalue);
        if(this.inputvalue > 0){
            this.Buttontrue=false;
        }
        else{
            this.Buttontrue= true;
        }
    }

    checkindate1(event){
        this.date1=event.target.value;
        console.log("check in:",this.date1);
    }
    @wire(getObjectInfo, { objectApiName: HOTEL_OBJECT })
    objectInfo;
    // Picklist values based on record type
    @wire(getPicklistValuesByRecordType, { objectApiName: HOTEL_OBJECT, recordTypeId: '$objectInfo.data.defaultRecordTypeId'})
    zonePicklistValues({error, data}) {
        if(data) {
            this.error = null;
            let zoneOptions = [{label:'--None--', value:'--None--'}];
            // Zone Control Field Picklist values
           data.picklistFieldValues.zone__c.values.forEach(key => {
                zoneOptions.push({
                    label : key.label,
                    value: key.value
                })
            });
            
            this.controllingValues = zoneOptions;
            let stateOptions = [{label:'--None--', value:'--None--'}];
             // State Control Field Picklist values
            this.controlValues = data.picklistFieldValues.States__c.controllerValues;
            // State dependent Field Picklist values
            this.totalDependentValues = data.picklistFieldValues.States__c.values;
           
            let hotelOptions = [{label:'--None--',value:'--None--'}];
            //Hotel field picklist values
            this.controlValues2 = data.picklistFieldValues.Hotel__c.controllerValues;
            // Hotel dependent Field Picklist values
           this.totalDepHotelValues = data.picklistFieldValues.Hotel__c.values;
            
        }
        else if(error) {
            this.error = JSON.stringify(error);
        }
    }
    handleZoneChange(event) {
        // Selected Zone Value
        this.selectedZone = event.target.value;
       // this.isEmpty = true;
        let dependValues = [];
        if(this.selectedZone) {
            // if Selected Zone is none returns nothing
            if(this.selectedZone === '--None--') {
                this.isEmpty = true;
                dependValues = [{label:'--None--', value:'--None--'}];
                this.selectedZone = null;
                this.selectedState = null;
                this.selectedHotel = null;
                return;
            }
            // filter the total dependent values based on selected Zone value 
            this.totalDependentValues.forEach(conValues => {
                if(conValues.validFor[0] === this.controlValues[this.selectedZone]) {
                    dependValues.push({
                        label: conValues.label,
                        value: conValues.value
                    })
                }
            })
            this.dependentValues = dependValues;
           // console.log('state value'+JSON.stringify(this.dependentValues));
        }
    }
    handleStateChange(event) {
        this.selectedState = event.target.value;
        this.isEmpty = false;
        let depend2Values = [];
        if(this.selectedState) {
            // if Selected state is none returns nothing
            if(this.selectedState === '--None--') {
                this.isEmpty = true;
                depend2Values = [{label:'--None--', value:'--None--'}];
                this.selectedState = null;
                this.selectedHotel = null;
                return;
            }
            // filter the total dependent values based on selected Zone value 
            this.totalDepHotelValues.forEach(hValues => {
                if(hValues.validFor[0] === this.controlValues2[this.selectedState]) {
                    depend2Values.push({
                        label: hValues.label,
                        value: hValues.value
                    })
                }
            })
            this.hotelvalues = depend2Values;
          //  console.log('on state change'+ JSON.stringify(this.hotelvalues));
        }
    }

    handleHotelChange(event){
        this.selectedHotel = event.target.value;
    }
    
     /*takeInputData(){
        this.loaded = !this.loaded;
        this.zone = this.template.querySelector(".zone").value;
        this.state = this.template.querySelector(".state").value;
        this.hotelid = this.template.querySelector(".hotel").value;
        this.checkindate = this.template.querySelector(".checkin").value;
        this.checkoutdate = this.template.querySelector(".checkoutdate").value;
        this.bookeremail = this.template.querySelector(".bookeremail").value;
       // if(test){
            searchroom({hotelid:this.hotelid,cindate:this.checkindate,coutdate:this.checkoutdate})
            .then(result =>{
                //console.log('============result '+JSON.stringify(result));
                this.roomTypeList = result;
                console.log('accesskey'+ this.roomTypeList[0].accesskey);
                this.loaded=true;
            })
            .catch(error=>{
                    this.loaded=true;
                    console.log('============search'+JSON.stringify(error));
            });
      //  }
   }
   saveBooking(){
        this.loaded = !this.loaded;
        addtocart({accesskey:this.roomTypeList[0].accesskey,accesssecret:this.roomTypeList[0].accesssecret,rates:JSON.stringify(this.ratesIds)})
        .then(result =>{
            //console.log('============result '+JSON.stringify(result));
            this.loaded=true;
        })
        .catch(error=>{
                this.loaded=true;
                console.log('============save booking error'+JSON.stringify(error));
        });
}*/
    handleChangeRegion(event) {
        this.value = event.detail.value;
    }
    handleChangeHotel(event) {
        this.id = event.detail.value;
    }
    ratesIds = [];
    handleAddAction(event) {
        if(!this.ratesIds.includes(event.currentTarget.dataset.key)){
            this.ratesIds.push({value:event.currentTarget.dataset.key});
        }
        console.log('rates id++'+ JSON.stringify(this.ratesIds));         
    }
    reload(){
        location.reload();
    }
    @track value = "initial value";
handleClick(evt) {
    console.log('Current value of the input: ' + evt.target.value);
    const allValid = [...this.template.querySelectorAll('.zone'),...this.template.querySelectorAll('.state'),...this.template.querySelectorAll('.hotel'),...this.template.querySelectorAll('.checkin'),...this.template.querySelectorAll('.checkoutdate'),...this.template.querySelectorAll('.bookeremail')]
        .reduce((validSoFar, inputCmp) => {
                    inputCmp.reportValidity();
                    return validSoFar && inputCmp.checkValidity();
        }, true);
    if (allValid) {
        //alert('All form entries look valid. Ready to submit!');
        this.loaded = !this.loaded;
        this.zone = this.template.querySelector(".zone").value;
        this.state = this.template.querySelector(".state").value;
        this.hotelid = this.template.querySelector(".hotel").value;
        this.checkindate = this.template.querySelector(".checkin").value;
        this.checkoutdate = this.template.querySelector(".checkoutdate").value;
        this.bookeremail = this.template.querySelector(".bookeremail").value;
       // if(test){
            searchroom({hotelid:this.hotelid,cindate:this.checkindate,coutdate:this.checkoutdate})
            .then(result =>{
                //console.log('============result '+JSON.stringify(result));
                this.roomTypeList = result;
                console.log('accesskey'+ this.roomTypeList[0].accesskey);
                this.loaded=true;
            })
            .catch(error=>{
                    this.loaded=true;
                    console.log('============search'+JSON.stringify(error));
            });
    } else {
        alert('Please update the invalid form entries and try again.');
    }
}
    
}
 
test.html:

In this html I have a input function and a lightining-button component
The code is as below.

<template>
    
            <lightning-button-group style="float:right;">
            <input type="number" value="" style="width:60px;float:right;border:1px solid grey;"></input>        
                <lightning-button label="Add"  disabled></lightning-button>
                <lightning-button-icon icon-name="utility:delete" variant="border-filled" alternative-text="Delete"></lightning-button-icon>
            </lightning-button-group><br/><br/>
            
</template>

test.js:

Here based on the input value in the html code I need to enable the disabled Add button in the html code.
The condition is if input value is greater than 0 it should get enabled.
the code is as below:

import { LightningElement } from 'lwc';
export default class ButtonGroupBasic extends LightningElement {
    renderedCallback() {
        let inp = this.template.querySelector('input');
        let test = this.template.querySelector('lightning-button');
        if(inp > 0){
            test.disabled = false;
        }
         
    }
}

Please let me know where I am going wrong in this code.
test.html:

In this html I have a input function and a lightining-button component
The code is as below.

<template>
    
            <lightning-button-group style="float:right;">
            <input type="number" value="" style="width:60px;float:right;border:1px solid grey;"></input>        
                <lightning-button label="Add" ></lightning-button>
                <lightning-button-icon icon-name="utility:delete" variant="border-filled" alternative-text="Delete"></lightning-button-icon>
            </lightning-button-group><br/><br/>
            
</template>

test.js:

Here based on the input value in the html code I need to enable or disable a Add button in the html code.
The condition is if input value is o or less than o the ad buttoin should be disabled, otherwise it should get enable.

the code is as below:

import { LightningElement } from 'lwc';
export default class ButtonGroupBasic extends LightningElement {
    renderedCallback() {
        let inp = this.template.querySelector('input');
        let test = this.template.querySelector('lightning-button');
        if(inp <= 0){
            test.disabled = true;
        }
        else{
            test.disabled = false;
        }
         
    }
}

The Disbaled function is not working.
Please let me know where I am going wrong in this code.
Apex Class:

public class createCorporate {
    public Account acc {get;set;}
    public List<Contact> conList {get;set;}
    public AccountWrapper.cls_billing cbilling {get;set;}
    public AccountWrapper.cls_personal personal {get;set;}
    public Id Id{get;set;}
    public String message{get;set;}
    public string updatedmessage{get;set;}
    CorporateResponse core = new CorporateResponse();

    
    public createCorporate(ApexPages.StandardController controller){
        acc = (Account) controller.getRecord();
        Id = acc.Id;
    }
    public void createCorporatedata(){
        HMACGenearatorHandler hg = new HMACGenearatorHandler();
        fromJSON obj = new fromJSON();
        HMACGenearatorHandler.Wrapper wr;
        wr = hg.createJson();
        if(wr.response != null){
            obj = obj.parse(wr.response);
            string accesssecret = obj.hotelogix.response.accesssecret;
            string accesskey = obj.hotelogix.response.accesskey;
        
        acc= new Account();
        Contact con = new Contact();
        AccountWrapper aw = new AccountWrapper();
        AccountWrapper.cls_personal personal = new AccountWrapper.cls_personal();
        AccountWrapper.cls_billing cbilling = new  AccountWrapper.cls_billing();
        acc= [Select id,Name,taxCode__c,Account_Address__c,Account_State__c,Account_City__c,Account_Pincode__c,
              BillingStreet,BillingCity,BillingCountry,BillingState,BillingPostalCode,(Select id,Title,name,Type__c,Contact_Designation__c,
              Birthdate,Email,Gender__c,Fax,FirstName,LastName,MobilePhone,Phone                                                                        
              from contacts where Type__c != 'Others' ORDER BY Type__c ASC LIMIT 2) from Account where id =:Id];
        conList= acc.contacts;
        system.debug('con+++'+conList);
        for(Contact c : conList){
            if(c.Type__c =='Personal'){
                personal.salutation= c.Title;
                personal.designation =c.Contact_Designation__c;
                personal.dob =string.valueOf(c.Birthdate);
                personal.email =c.Email;
                personal.faxNo = c.Fax;
                personal.fName = c.FirstName;
                personal.gender =c.Gender__c;
                personal.lName = c.LastName;
                personal.mobileNo =c.MobilePhone;
                personal.phoneExtension='';
                personal.phoneNo =c.Phone;
                personal.website ='';               
            }
            if(c.Type__c =='Billing'){
                cbilling.salutation= c.Title;
                cbilling.designation =c.Contact_Designation__c;
                cbilling.dob =string.valueOf(c.Birthdate);
                cbilling.email =c.Email;
                cbilling.faxNo = c.Fax;
                cbilling.fName = c.FirstName;
                cbilling.gender =c.Gender__c;
                cbilling.lName = c.LastName;
                cbilling.mobileNo =c.MobilePhone;
                cbilling.phoneExtension='';
                cbilling.phoneNo =c.Phone;
                cbilling.website ='';      
            }
        }
        AccountWrapper.cls_office office = new AccountWrapper.cls_office();
        office.address = acc.Account_Address__c;
        office.city = acc.Account_City__c;
        office.country ='India';
        office.state=acc.Account_State__c;
        office.zip = String.valueOf(acc.Account_Pincode__c);
        
        AccountWrapper.cls_billingAddress billingad = new AccountWrapper.cls_billingAddress();
        billingad.companyName = acc.Name;
        billingad.address = acc.BillingStreet;
        billingad.city = acc.BillingCity;
        billingad.country = acc.BillingCountry;
        billingad.state=acc.BillingState;
        billingad.zip = acc.BillingPostalCode;
               
        AccountWrapper.cls_addresses addresses = new AccountWrapper.cls_addresses();
        addresses.office = office;
        addresses.billingaddress = billingad;
 
        AccountWrapper.cls_contacts contacts = new AccountWrapper.cls_contacts();
        contacts.personal = personal;
        contacts.billing = cbilling;
        
        AccountWrapper.cls_creditCardDetail carddetails = new AccountWrapper.cls_creditCardDetail();
        carddetails.nameOnCard ='Puja';
        carddetails.cardType ='Visa';
        carddetails.cardNo ='4111111111111111';
        carddetails.cvc ='256';
        carddetails.city='Delhi';
        carddetails.expiryMonth ='05';
        carddetails.expiryYear ='2022';
        carddetails.zip ='256';
        carddetails.address ='noida';
        carddetails.state ='delhi';
        carddetails.country ='India';
        
        List<AccountWrapper.cls_hotels> hotels = new List<AccountWrapper.cls_hotels>();
        AccountWrapper.cls_hotels hotel = new AccountWrapper.cls_hotels();
        hotel.id ='51237';
        hotels.add(hotel);
        
        AccountWrapper.cls_data data = new AccountWrapper.cls_data();
        data.groupCode='';
        data.businessName=acc.Name;
        data.taxCode =acc.taxCode__c;
        data.addresses= addresses;
        data.contacts = contacts;
        data.creditCardDetail = carddetails;
        data.creditLimit='100';
        data.paymentTerms='5';
        data.discount='10';
        data.discountable=true;
        data.hotels = hotels;
        
        AccountWrapper.cls_request req = new AccountWrapper.cls_request();
        req.key =accesskey;
        req.method='createcorporate';
        req.data = data;
        
        AccountWrapper.cls_hotelogix hlogix = new AccountWrapper.cls_hotelogix();
        hlogix.version='1.0';
        hlogix.datetime_x =wr.myDate;
        hlogix.request = req;
        aw.hotelogix = hlogix;
        String corporateJSON = JSON.serialize(aw);
        corporateJSON = corporateJSON.replace('datetime_x', 'datetime');
        system.debug('corporateJSON: '+ corporateJSON); 
        String mac2=hg.generateHmacSHA1Signature(corporateJSON,accesssecret);
        sendcreateCorpRequest(corporateJSON,mac2);
        } 
    } 
    public static void sendcreateCorpRequest(String corporatejson,String mac2){
        System.debug('mac2+++  '+ mac2);
        HttpRequest req = new HttpRequest();
        req.setEndpoint(System.Label.createCorporate);
        req.setMethod('POST');
        req.setHeader('X-HAPI-Signature',mac2);
        req.setHeader('Content-Type', System.label.Content_Type); 
        req.setBody(corporatejson);
        Http http = new Http();
        HTTPResponse res = http.send(req);
           System.debug(res);
           System.debug('createcorp++++ '+res.getBody());
           System.debug('GET STATUS +++ '+res.getStatus());
           String response = res.getBody();
           CorporateResponse core = new CorporateResponse();
           core = core.parse(response);
           System.debug('core++'+core);
           String message = core.hotelogix.response.status.message;
           System.debug(message);
           String updatedmessage = core.hotelogix.response.hotels[0].updateStatus.message;
           System.debug(updatedmessage);
      }
    
}


Visualforce Page:

<apex:page standardController="Account" extensions="createCorporate" action="{!createCorporatedata}">
            {!message}
            {!updatedmessage}
</apex:page>
 
test.html:

In this html I have a input function and a lightining-button component
The code is as below.

<template>
    
            <lightning-button-group style="float:right;">
            <input type="number" value="" style="width:60px;float:right;border:1px solid grey;"></input>        
                <lightning-button label="Add"  disabled></lightning-button>
                <lightning-button-icon icon-name="utility:delete" variant="border-filled" alternative-text="Delete"></lightning-button-icon>
            </lightning-button-group><br/><br/>
            
</template>

test.js:

Here based on the input value in the html code I need to enable the disabled Add button in the html code.
The condition is if input value is greater than 0 it should get enabled.
the code is as below:

import { LightningElement } from 'lwc';
export default class ButtonGroupBasic extends LightningElement {
    renderedCallback() {
        let inp = this.template.querySelector('input');
        let test = this.template.querySelector('lightning-button');
        if(inp > 0){
            test.disabled = false;
        }
         
    }
}

Please let me know where I am going wrong in this code.
test.html:

In this html I have a input function and a lightining-button component
The code is as below.

<template>
    
            <lightning-button-group style="float:right;">
            <input type="number" value="" style="width:60px;float:right;border:1px solid grey;"></input>        
                <lightning-button label="Add" ></lightning-button>
                <lightning-button-icon icon-name="utility:delete" variant="border-filled" alternative-text="Delete"></lightning-button-icon>
            </lightning-button-group><br/><br/>
            
</template>

test.js:

Here based on the input value in the html code I need to enable or disable a Add button in the html code.
The condition is if input value is o or less than o the ad buttoin should be disabled, otherwise it should get enable.

the code is as below:

import { LightningElement } from 'lwc';
export default class ButtonGroupBasic extends LightningElement {
    renderedCallback() {
        let inp = this.template.querySelector('input');
        let test = this.template.querySelector('lightning-button');
        if(inp <= 0){
            test.disabled = true;
        }
        else{
            test.disabled = false;
        }
         
    }
}

The Disbaled function is not working.
Please let me know where I am going wrong in this code.
Apex Class:

public class createCorporate {
    public Account acc {get;set;}
    public List<Contact> conList {get;set;}
    public AccountWrapper.cls_billing cbilling {get;set;}
    public AccountWrapper.cls_personal personal {get;set;}
    public Id Id{get;set;}
    public String message{get;set;}
    public string updatedmessage{get;set;}
    CorporateResponse core = new CorporateResponse();

    
    public createCorporate(ApexPages.StandardController controller){
        acc = (Account) controller.getRecord();
        Id = acc.Id;
    }
    public void createCorporatedata(){
        HMACGenearatorHandler hg = new HMACGenearatorHandler();
        fromJSON obj = new fromJSON();
        HMACGenearatorHandler.Wrapper wr;
        wr = hg.createJson();
        if(wr.response != null){
            obj = obj.parse(wr.response);
            string accesssecret = obj.hotelogix.response.accesssecret;
            string accesskey = obj.hotelogix.response.accesskey;
        
        acc= new Account();
        Contact con = new Contact();
        AccountWrapper aw = new AccountWrapper();
        AccountWrapper.cls_personal personal = new AccountWrapper.cls_personal();
        AccountWrapper.cls_billing cbilling = new  AccountWrapper.cls_billing();
        acc= [Select id,Name,taxCode__c,Account_Address__c,Account_State__c,Account_City__c,Account_Pincode__c,
              BillingStreet,BillingCity,BillingCountry,BillingState,BillingPostalCode,(Select id,Title,name,Type__c,Contact_Designation__c,
              Birthdate,Email,Gender__c,Fax,FirstName,LastName,MobilePhone,Phone                                                                        
              from contacts where Type__c != 'Others' ORDER BY Type__c ASC LIMIT 2) from Account where id =:Id];
        conList= acc.contacts;
        system.debug('con+++'+conList);
        for(Contact c : conList){
            if(c.Type__c =='Personal'){
                personal.salutation= c.Title;
                personal.designation =c.Contact_Designation__c;
                personal.dob =string.valueOf(c.Birthdate);
                personal.email =c.Email;
                personal.faxNo = c.Fax;
                personal.fName = c.FirstName;
                personal.gender =c.Gender__c;
                personal.lName = c.LastName;
                personal.mobileNo =c.MobilePhone;
                personal.phoneExtension='';
                personal.phoneNo =c.Phone;
                personal.website ='';               
            }
            if(c.Type__c =='Billing'){
                cbilling.salutation= c.Title;
                cbilling.designation =c.Contact_Designation__c;
                cbilling.dob =string.valueOf(c.Birthdate);
                cbilling.email =c.Email;
                cbilling.faxNo = c.Fax;
                cbilling.fName = c.FirstName;
                cbilling.gender =c.Gender__c;
                cbilling.lName = c.LastName;
                cbilling.mobileNo =c.MobilePhone;
                cbilling.phoneExtension='';
                cbilling.phoneNo =c.Phone;
                cbilling.website ='';      
            }
        }
        AccountWrapper.cls_office office = new AccountWrapper.cls_office();
        office.address = acc.Account_Address__c;
        office.city = acc.Account_City__c;
        office.country ='India';
        office.state=acc.Account_State__c;
        office.zip = String.valueOf(acc.Account_Pincode__c);
        
        AccountWrapper.cls_billingAddress billingad = new AccountWrapper.cls_billingAddress();
        billingad.companyName = acc.Name;
        billingad.address = acc.BillingStreet;
        billingad.city = acc.BillingCity;
        billingad.country = acc.BillingCountry;
        billingad.state=acc.BillingState;
        billingad.zip = acc.BillingPostalCode;
               
        AccountWrapper.cls_addresses addresses = new AccountWrapper.cls_addresses();
        addresses.office = office;
        addresses.billingaddress = billingad;
 
        AccountWrapper.cls_contacts contacts = new AccountWrapper.cls_contacts();
        contacts.personal = personal;
        contacts.billing = cbilling;
        
        AccountWrapper.cls_creditCardDetail carddetails = new AccountWrapper.cls_creditCardDetail();
        carddetails.nameOnCard ='Puja';
        carddetails.cardType ='Visa';
        carddetails.cardNo ='4111111111111111';
        carddetails.cvc ='256';
        carddetails.city='Delhi';
        carddetails.expiryMonth ='05';
        carddetails.expiryYear ='2022';
        carddetails.zip ='256';
        carddetails.address ='noida';
        carddetails.state ='delhi';
        carddetails.country ='India';
        
        List<AccountWrapper.cls_hotels> hotels = new List<AccountWrapper.cls_hotels>();
        AccountWrapper.cls_hotels hotel = new AccountWrapper.cls_hotels();
        hotel.id ='51237';
        hotels.add(hotel);
        
        AccountWrapper.cls_data data = new AccountWrapper.cls_data();
        data.groupCode='';
        data.businessName=acc.Name;
        data.taxCode =acc.taxCode__c;
        data.addresses= addresses;
        data.contacts = contacts;
        data.creditCardDetail = carddetails;
        data.creditLimit='100';
        data.paymentTerms='5';
        data.discount='10';
        data.discountable=true;
        data.hotels = hotels;
        
        AccountWrapper.cls_request req = new AccountWrapper.cls_request();
        req.key =accesskey;
        req.method='createcorporate';
        req.data = data;
        
        AccountWrapper.cls_hotelogix hlogix = new AccountWrapper.cls_hotelogix();
        hlogix.version='1.0';
        hlogix.datetime_x =wr.myDate;
        hlogix.request = req;
        aw.hotelogix = hlogix;
        String corporateJSON = JSON.serialize(aw);
        corporateJSON = corporateJSON.replace('datetime_x', 'datetime');
        system.debug('corporateJSON: '+ corporateJSON); 
        String mac2=hg.generateHmacSHA1Signature(corporateJSON,accesssecret);
        sendcreateCorpRequest(corporateJSON,mac2);
        } 
    } 
    public static void sendcreateCorpRequest(String corporatejson,String mac2){
        System.debug('mac2+++  '+ mac2);
        HttpRequest req = new HttpRequest();
        req.setEndpoint(System.Label.createCorporate);
        req.setMethod('POST');
        req.setHeader('X-HAPI-Signature',mac2);
        req.setHeader('Content-Type', System.label.Content_Type); 
        req.setBody(corporatejson);
        Http http = new Http();
        HTTPResponse res = http.send(req);
           System.debug(res);
           System.debug('createcorp++++ '+res.getBody());
           System.debug('GET STATUS +++ '+res.getStatus());
           String response = res.getBody();
           CorporateResponse core = new CorporateResponse();
           core = core.parse(response);
           System.debug('core++'+core);
           String message = core.hotelogix.response.status.message;
           System.debug(message);
           String updatedmessage = core.hotelogix.response.hotels[0].updateStatus.message;
           System.debug(updatedmessage);
      }
    
}


Visualforce Page:

<apex:page standardController="Account" extensions="createCorporate" action="{!createCorporatedata}">
            {!message}
            {!updatedmessage}
</apex:page>