diff --git a/Mohem/src/app/eit/models/eit-address.request.ts b/Mohem/src/app/eit/models/eit-address.request.ts index 3254b52f..45730ca4 100644 --- a/Mohem/src/app/eit/models/eit-address.request.ts +++ b/Mohem/src/app/eit/models/eit-address.request.ts @@ -8,7 +8,8 @@ export class EitAddressRequest { public P_FUNCTION_NAME: string; public P_SELECTED_RESP_ID: Number; P_DESC_FLEX_CONTEXT_CODE: string; - EITTransactionTBL: EitTransactionModel[]; - P_COUNTRY_CODE: string - P_EFFECTIVE_DATE: string + P_TRANSACTION_VALUES_TBL: EitTransactionModel[]; + P_COUNTRY_CODE: string; + P_EFFECTIVE_DATE: string; + P_ACTION: string; } \ No newline at end of file diff --git a/Mohem/src/app/profile/add-address/add-address.component.ts b/Mohem/src/app/profile/add-address/add-address.component.ts index 532fccf0..d320f7bb 100644 --- a/Mohem/src/app/profile/add-address/add-address.component.ts +++ b/Mohem/src/app/profile/add-address/add-address.component.ts @@ -125,7 +125,7 @@ export class AddAddressComponent implements OnInit { // this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME; // this.menuType = this.selMenu.List_Menu.MENU_TYPE; // this.validateEitObj = this.addEITData.submitEITObjList; - // this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; + this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; // this.eitSubmitAction = this.cs.sharedService.getSharedData( // EITTransactionsRequest.SUBMIT_EIT_ACTION // ); @@ -1506,8 +1506,8 @@ export class AddAddressComponent implements OnInit { } submitEit() { - let list = this.eitRequest.EITTransactionTBL; - this.eitRequest.EITTransactionTBL = this.fixTransactionNo(list); + // let list = this.eitRequest.EITTransactionTBL; + // this.eitRequest.EITTransactionTBL = this.fixTransactionNo(list); this.eitService .submitEit(this.eitRequest) @@ -1582,11 +1582,12 @@ export class AddAddressComponent implements OnInit { P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE, P_SELECTED_RESP_ID: this.respID, //this.selMenu.List_Menu.RESP_ID,//-999, - P_FUNCTION_NAME: this.functionName, + P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME, P_DESC_FLEX_CONTEXT_CODE: this.eitResponse[0].DESC_FLEX_CONTEXT_CODE, - EITTransactionTBL: this.arrValues, + P_TRANSACTION_VALUES_TBL: this.arrValues, P_COUNTRY_CODE: this.country, - P_EFFECTIVE_DATE: '28-June-2021' + P_EFFECTIVE_DATE: '28-June-2021', + P_ACTION: 'NEW' }; this.profileService diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html index fd70891c..adfd1d65 100644 --- a/Mohem/src/app/profile/home/home.component.html +++ b/Mohem/src/app/profile/home/home.component.html @@ -151,10 +151,13 @@ - + + + +
@@ -182,7 +185,7 @@ - - + + Update @@ -258,7 +264,6 @@
- + --> - \ No newline at end of file diff --git a/Mohem/src/app/profile/home/home.component.scss b/Mohem/src/app/profile/home/home.component.scss index cfe18dd7..1b0a45a3 100644 --- a/Mohem/src/app/profile/home/home.component.scss +++ b/Mohem/src/app/profile/home/home.component.scss @@ -1075,4 +1075,11 @@ $actionBtnSize: 36px; } .add{ --background: #00bcd4; background: white; width: 100%; +} +.add-icon-styling { + background-color: #191814; + width: 35px; + height: 35px; + color: white; + border-radius: 50%; } \ No newline at end of file diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts index 93218683..a12852d2 100644 --- a/Mohem/src/app/profile/home/home.component.ts +++ b/Mohem/src/app/profile/home/home.component.ts @@ -41,7 +41,13 @@ export class HomeComponent implements OnInit { public menuEntries: any; public basicDetailsSubMenu: any; public addressSubMenu: any; - transactionNo = 0; + public transactionNo = 0; + public address: any; + public street: any; + public area: any; + public poBox: any; + public city: any; + public postalCode: any; public employeeAdress: any = []; constructor( @@ -65,12 +71,20 @@ export class HomeComponent implements OnInit { this.targetValue = params.targetValue; if (this.targetValue === 'sideMenu') { this.personalInfoSegment = true; + this.basicDetailsSegment = false; + this.addressSegment = false; } else if (this.targetValue === 'basicDetails') { + this.personalInfoSegment = false; this.basicDetailsSegment = true; + this.addressSegment = false; } else if (this.targetValue === 'address') { + this.personalInfoSegment = false; + this.basicDetailsSegment = false; this.addressSegment = true; } else { this.personalInfoSegment = true; + this.basicDetailsSegment = false; + this.addressSegment = false; } }); } @@ -106,7 +120,27 @@ export class HomeComponent implements OnInit { } console.log(this.basicDetailsSubMenu); console.log(this.addressSubMenu); + } + public getProfile() { + console.log('getProfile'); + this.authService + .loadAuthenticatedUser() + .subscribe((user: AuthenticatedUser) => { + if (user) { + console.log(user); + this.personalInfo = user; + if (this.cs.getUpdateImage().status) { + this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img); + } else { + this.user_image = user.EMPLOYEE_IMAGE + ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE + : '../assets/imgs/profile.png'; + } + this.getBasicDetails(); + this.getAddress(); + } + }); } public getBasicDetails() { @@ -119,7 +153,6 @@ export class HomeComponent implements OnInit { if (this.cs.validResponse(result)) { this.employeeBasicDetails = result.GetEmployeeBasicDetailsList; console.log(this.employeeBasicDetails); - this.getAddress(); for (let i = 0; i < this.employeeBasicDetails.length; i++) { if (this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME === 'FULL_NAME') { this.fullName = this.employeeBasicDetails[i].SEGMENT_VALUE_DSP; @@ -135,24 +168,31 @@ export class HomeComponent implements OnInit { }); } - public getProfile() { - console.log('getProfile'); - this.authService - .loadAuthenticatedUser() - .subscribe((user: AuthenticatedUser) => { - if (user) { - console.log(user); - this.personalInfo = user; - if (this.cs.getUpdateImage().status) { - this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img); - } else { - this.user_image = user.EMPLOYEE_IMAGE - ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE - : '../assets/imgs/profile.png'; - } - this.getBasicDetails(); + public getAddress() { + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.personalInfo.EMPLOYEE_NUMBER, + P_MENU_TYPE: "E", + P_SELECTED_RESP_ID: -999 + }; + this.profileService.getEmployeeAddress(body).subscribe((result) => { + console.log(result); + this.employeeAdress = result.GetEmployeeAddressList; + 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; + } else if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'REGION_1') { + this.street = this.employeeAdress[i].SEGMENT_VALUE_DSP; + } else if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'REGION_2') { + 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') { + this.city = this.employeeAdress[i].SEGMENT_VALUE_DSP; + } else if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'POSTAL_CODE') { + this.postalCode = this.employeeAdress[i].SEGMENT_VALUE_DSP; } - }); + } + }) } public openEditprofile() { @@ -228,7 +268,7 @@ export class HomeComponent implements OnInit { this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData'); this.cs.openAddBasicDetails(); } else { - // this.cs.openProfile('address'); + this.cs.openAddAddress(); } } @@ -251,21 +291,11 @@ export class HomeComponent implements OnInit { return await modal.present(); } - updateImageProfile() { + public updateImageProfile() { this.cs.openChangeImagePage(); } - getAddress() { - const body = { - P_SELECTED_EMPLOYEE_NUMBER: this.personalInfo.EMPLOYEE_NUMBER, - P_MENU_TYPE: "E", - P_SELECTED_RESP_ID: -999 - }; - this.profileService.getEmployeeAddress(body).subscribe((result) => { - console.log(result); - this.employeeAdress = result.GetEmployeeAddressList; - }) - } - openAddAddress() { + + public openAddAddress() { this.cs.openAddAddress(); } }