From 1b875b8bc452fc1d29521d39798aecbbc438de5e Mon Sep 17 00:00:00 2001 From: ashwaq Date: Sun, 15 Mar 2020 10:46:53 +0300 Subject: [PATCH] fix replacment inif --- .../replacement-list.component.ts | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.ts b/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.ts index 731fe21d..b583fae8 100644 --- a/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.ts +++ b/Mohem/src/app/vacation-rule/replacement-list/replacement-list.component.ts @@ -31,10 +31,12 @@ export class ReplacementListComponent implements OnInit { active: any; isSelect: boolean =false; searchKeyEnter: boolean = false; + request: ReplacementServiceRequest; constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, public modalController: ModalController) { } ngOnInit() { + this.request = new ReplacementServiceRequest(); } @@ -79,15 +81,15 @@ export class ReplacementListComponent implements OnInit { this.P_SEARCH_EMAIL_ADDRESS = ""; } - const request = new ReplacementServiceRequest(); - request.P_SEARCH_USER_NAME = this.P_SEARCH_USER_NAME; - request.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.P_SEARCH_EMPLOYEE_DISPLAY_NAME; - request.P_SEARCH_EMAIL_ADDRESS = this.P_SEARCH_EMAIL_ADDRESS; - request.P_PAGE_NUM = this.P_PAGE_NUM; - request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; - request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + // const request = new ReplacementServiceRequest(); + this.request.P_SEARCH_USER_NAME = this.P_SEARCH_USER_NAME; + this.request.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.P_SEARCH_EMPLOYEE_DISPLAY_NAME; + this.request.P_SEARCH_EMAIL_ADDRESS = this.P_SEARCH_EMAIL_ADDRESS; + this.request.P_PAGE_NUM = this.P_PAGE_NUM; + this.request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + this.request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; - this.vacationRuleService.getReplacementList(request). + this.vacationRuleService.getReplacementList(this.request). subscribe((result: any) => { this.handleReplacment(result); }); @@ -167,13 +169,14 @@ export class ReplacementListComponent implements OnInit { if (!this.IsReachEnd) { - const request = new ReplacementServiceRequest(); - request.P_PAGE_NUM = this.P_PAGE_NUM; - request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + ///const request = new ReplacementServiceRequest(); + console.log(this.request.P_SEARCH_USER_NAME + "-" + this.request.P_SEARCH_EMAIL_ADDRESS + "-" + this.request.P_SEARCH_EMPLOYEE_DISPLAY_NAME ) + this.request.P_PAGE_NUM = this.P_PAGE_NUM; + this.request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; // request.P_SELECTED_EMPLOYEE_NUMBER=this.selEmp; - this.vacationRuleService.getReplacementList(request). + this.vacationRuleService.getReplacementList(this.request). subscribe((result: any) => { if (this.cs.validResponse(result)) { if (this.cs.hasData(result.ReplacementList)) {