@ -48,7 +48,7 @@ export class HomeComponent implements OnInit {
public poBox : any ;
public city : any ;
public postalCode : any ;
public country : any ;
public employeeAdress : any = [ ] ;
constructor (
public ts : TranslatorService ,
@ -91,7 +91,7 @@ export class HomeComponent implements OnInit {
ngOnInit() {
this . getProfile ( ) ;
this . menuEntries = this . cs . sharedService . getSharedData ( 'menuEntries' , false ) ;
this . menuEntries = this . cs . sharedService . getSharedData ( 'menuEntries' , false ) ;
if ( this . menuEntries ) {
this . setMenuEntries ( ) ;
}
@ -101,14 +101,14 @@ export class HomeComponent implements OnInit {
let personalInformationChildren : any ;
let personalInfoNestedChildren : any ;
if ( this . targetValue === 'sideMenu' ) {
for ( let i = 0 ; i < this . menuEntries . length ; i ++ ) {
if ( this . targetValue === 'sideMenu' ) {
for ( let i = 0 ; i < this . menuEntries . length ; i ++ ) {
if ( this . menuEntries [ i ] . MENU_NAME === 'MBL_E_PROFESSIONALS_01' ) {
personalInformationChildren = this . menuEntries [ i ] . children ;
for ( let j = 0 ; j < personalInformationChildren . length ; j ++ ) {
for ( let j = 0 ; j < personalInformationChildren . length ; j ++ ) {
if ( personalInformationChildren [ j ] . MENU_NAME = 'MBL_PERINFO_SS' && personalInformationChildren [ j ] . ENTRY_SEQUENCE === 15 ) {
personalInfoNestedChildren = personalInformationChildren [ j ] . children ;
for ( let k = 0 ; k < personalInfoNestedChildren . length ; k ++ ) {
for ( let k = 0 ; k < personalInfoNestedChildren . length ; k ++ ) {
if ( personalInfoNestedChildren [ k ] . REQUEST_TYPE === 'BASIC_DETAILS' ) {
this . basicDetailsSubMenu = personalInfoNestedChildren [ k ] ;
}
@ -122,7 +122,7 @@ export class HomeComponent implements OnInit {
}
} else {
const menuEntriesLocalArray : any = this . menuEntries . children ;
for ( let i = 0 ; i < menuEntriesLocalArray . length ; i ++ ) {
for ( let i = 0 ; i < menuEntriesLocalArray . length ; i ++ ) {
if ( menuEntriesLocalArray [ i ] . REQUEST_TYPE === 'BASIC_DETAILS' ) {
this . basicDetailsSubMenu = menuEntriesLocalArray [ i ] ;
}
@ -190,6 +190,7 @@ export class HomeComponent implements OnInit {
this . profileService . getEmployeeAddress ( body ) . subscribe ( ( result ) = > {
console . log ( result ) ;
this . employeeAdress = result . GetEmployeeAddressList ;
this . country = { name : result.P_COUNTRY_NAME , code : result.P_COUNTRY_CODE }
for ( let i = 0 ; i < this . employeeAdress . length ; i ++ ) {
if ( this . employeeAdress [ i ] . APPLICATION_COLUMN_NAME === 'ADDRESS_LINE1' ) {
this . address = this . employeeAdress [ i ] . SEGMENT_VALUE_DSP ;
@ -199,9 +200,9 @@ export class HomeComponent implements OnInit {
this . area = this . employeeAdress [ i ] . SEGMENT_VALUE_DSP ;
} else if ( this . employeeAdress [ i ] . APPLICATION_COLUMN_NAME === 'REGION_3' ) {
this . poBox = this . employeeAdress [ i ] . SEGMENT_VALUE_DSP ;
} else if ( this . employeeAdress [ i ] . APPLICATION_COLUMN_NAME === 'TOWN_OR_CITY' ) {
} else if ( this . employeeAdress [ i ] . APPLICATION_COLUMN_NAME === 'TOWN_OR_CITY' ) {
this . city = this . employeeAdress [ i ] . SEGMENT_VALUE_DSP ;
} else if ( this . employeeAdress [ i ] . APPLICATION_COLUMN_NAME === 'POSTAL_CODE' ) {
} else if ( this . employeeAdress [ i ] . APPLICATION_COLUMN_NAME === 'POSTAL_CODE' ) {
this . postalCode = this . employeeAdress [ i ] . SEGMENT_VALUE_DSP ;
}
}
@ -268,7 +269,7 @@ export class HomeComponent implements OnInit {
}
}
public allowEdit ( allowVal : string ) {
public allowEdit ( allowVal : string ) {
let selMenu : MenuResponse = new MenuResponse ( ) ;
selMenu = this . cs . sharedService . getSharedData ( MenuResponse . SHARED_DATA , false ) ;
@ -281,7 +282,7 @@ export class HomeComponent implements OnInit {
this . cs . sharedService . setSharedData ( { dirfromNotificationPage : false , submitEITObjList : undefined , transNo : this.transactionNo } , 'AddEITData' ) ;
this . cs . openAddBasicDetails ( ) ;
} else {
this . cs. openAddAddress( ) ;
this . openAddAddress( ) ;
}
}
@ -301,6 +302,21 @@ export class HomeComponent implements OnInit {
component : EditDetailProfileComponent ,
cssClass : 'my-custom-modal-css'
} ) ;
modal . onDidDismiss ( )
. then ( ( data ) = > {
console . log ( data ) ;
if ( data . data && data . data . data == 1 ) {
this . cs . sharedService . setSharedData ( this . addressSubMenu , ProfileService . ADRESS_ENTRIES ) ;
this . cs . sharedService . setSharedData ( this . employeeAdress , ProfileService . EMP_ADDRESS ) ;
this . cs . sharedService . setSharedData ( this . country , ProfileService . COUNTRY ) ;
this . cs . openAddAddress ( ) ;
} else if ( data . data && data . data . data == 2 ) {
this . cs . openAddAddress ( ) ;
}
} )
return await modal . present ( ) ;
}
@ -309,7 +325,14 @@ export class HomeComponent implements OnInit {
}
public openAddAddress() {
this . cs . openAddAddress ( ) ;
if ( this . addressSubMenu && this . addressSubMenu . UPDATE_BUTTON === 'Y' ) {
this . presentModal ( ) ;
} else {
this . cs . openAddAddress ( ) ;
}
}
}