@ -74,7 +74,11 @@ export class AddAddressComponent implements OnInit {
addEITData : any ;
addEITData : any ;
direction : string ;
direction : string ;
country : any = 'SA' ;
country : any = 'SA' ;
selectedCountryName : any ;
public effectiveDate : any ;
public effectiveDate : any ;
public submitAbsObjList : any = [ ] ;
public isUpdate : boolean ;
constructor (
constructor (
public modalController : ModalController ,
public modalController : ModalController ,
public cs : CommonService ,
public cs : CommonService ,
@ -137,8 +141,17 @@ export class AddAddressComponent implements OnInit {
ngAfterViewInit() {
ngAfterViewInit() {
console . log ( "ngAfterViewInit" ) ;
console . log ( "ngAfterViewInit" ) ;
// console.log(this.containerDiv.nativeElement);
// console.log(this.containerDiv.nativeElement);
var addressEntries = this . cs . sharedService . getSharedData ( ProfileService . ADRESS_ENTRIES ) ;
if ( addressEntries && addressEntries . UPDATE_BUTTON === 'Y' ) {
this . isUpdate = true ;
let countryDetail = this . cs . sharedService . getSharedData ( ProfileService . COUNTRY ) ;
this . selectedCountryName = countryDetail . name ;
this . country = countryDetail . code ;
}
this . getEitDffStructure ( ) ;
this . getEitDffStructure ( ) ;
// this.addFieldToDOM(this.buttonInput, 'btnSubmit', this.cs.presentAlert('Clicked!'), true)
// this.addFieldToDOM(this.buttonInput, 'btnSubmit', this.cs.presentAlert('Clicked!'), true)
this . getCountires ( ) ;
this . getCountires ( ) ;
this . effectiveDate = new Date ( ) ;
this . effectiveDate = new Date ( ) ;
}
}
@ -161,6 +174,10 @@ export class AddAddressComponent implements OnInit {
if ( result . GetAddressDffStructureList != null ) {
if ( result . GetAddressDffStructureList != null ) {
this . eitResponse = result . GetAddressDffStructureList ;
this . eitResponse = result . GetAddressDffStructureList ;
this . drawEitFields ( result . GetAddressDffStructureList ) ;
this . drawEitFields ( result . GetAddressDffStructureList ) ;
if ( this . isUpdate ) {
this . submitAbsObjList = this . cs . sharedService . getSharedData ( ProfileService . EMP_ADDRESS ) ;
this . fillAbsStructure ( ) ;
}
}
}
}
}
@ -1636,5 +1653,69 @@ export class AddAddressComponent implements OnInit {
this . countries = result [ 'GetCountriesList' ] ;
this . countries = result [ 'GetCountriesList' ] ;
} )
} )
}
}
fillAbsStructure() {
for ( let i = 0 ; i < this . submitAbsObjList . length ; i ++ ) {
let val : any ;
if ( this . submitAbsObjList [ i ] . VARCHAR2_VALUE )
val = this . submitAbsObjList [ i ] . VARCHAR2_VALUE ;
else if ( this . submitAbsObjList [ i ] . DATE_VALUE )
val = this . submitAbsObjList [ i ] . DATE_VALUE ;
else if ( this . submitAbsObjList [ i ] . NUMBER_VALUE )
val = this . submitAbsObjList [ i ] . NUMBER_VALUE ;
const elem = document . getElementById (
this . submitAbsObjList [ i ] . APPLICATION_COLUMN_NAME
) as HTMLInputElement ;
//obj.transactionNo=this.submitAbsObjList[i].TRANSACTION_NUMBER;
if ( elem ) {
if ( val ) {
let feldDetails = this . eitResponse . find (
x = >
x . APPLICATION_COLUMN_NAME ==
this . submitAbsObjList [ i ] . APPLICATION_COLUMN_NAME
) ;
if ( feldDetails ) {
let isStandardDate = this . isStandardDateVal ( feldDetails ) ;
let isStandardDateTime = this . isStandardDateTimeVal ( feldDetails ) ;
let isStandardTime = this . isStandardTimeVal ( feldDetails ) ;
if ( isStandardDate ) {
//elem.value = this.common.reverseFormatDate(val);
} else if ( isStandardDateTime ) {
// elem.innerHTML = this.common.reverseFormatStandardDate(val);
// elem.dataset.dtvalue = this.common.reverseFormatStandardDate(val);
} else if ( isStandardTime ) {
elem . innerHTML = val ;
elem . dataset . dtvalue = val ;
} else {
elem . value = val ;
elem . setAttribute ( "value" , elem . value ) ;
}
if (
feldDetails . DISPLAY_FLAG == "N" ||
( feldDetails . VALIDATION_TYPE != "N" &&
feldDetails . READ_ONLY == "Y" )
) {
elem . dataset . colmText = val ;
elem . value = this . submitAbsObjList [ i ] . SEGMENT_VALUE_DSP ;
elem . setAttribute ( "value" , elem . value ) ;
}
}
elem . dataset . hiddenval = val ; //hide the value to set it after calling get value set
if (
feldDetails . CHILD_SEGMENTS_VS_Splited &&
feldDetails . CHILD_SEGMENTS_VS_Splited . length > 0
) {
let listArray : any = feldDetails . CHILD_SEGMENTS_VS_Splited ;
listArray . forEach ( element = > {
this . getValueSet ( element ) ;
} ) ;
}
//var event = new Event('change');
//elem.dispatchEvent(event);
}
} else {
}
}
//this.ExtraObj=obj;
}
}
}