From 4468d8f26927466f9051b80b06b1a3d2d0225b23 Mon Sep 17 00:00:00 2001 From: chapal Date: Wed, 15 Jan 2025 16:47:46 +0600 Subject: [PATCH] profile --- .../general/general.component.html | 16 ++++++--- .../general/general.component.ts | 34 ++++++++++++++++--- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.html b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.html index 8895666..47395bf 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.html +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.html @@ -10,19 +10,27 @@
+ style="height: 180px; width: 180px; border-radius: 50%; border: 1px solid #52527A;" />
+
+ + +
+
-
+
+ +
@@ -601,4 +609,4 @@ Access Card - \ No newline at end of file + diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts index 4694dae..0f994ae 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts @@ -104,6 +104,7 @@ export class GeneralComponent implements OnInit { selectedFiles?: FileList; currentFile?: File; employeePhoto: any; + empSigneture: any; occupations: Occupation[]; newUser: boolean = false; userid: number; @@ -229,7 +230,7 @@ export class GeneralComponent implements OnInit { maxValue: new FormControl(), insuranceId: new FormControl(''), inclusionDate: new FormControl(), - //signature: new FormControl() + empSigneture: new FormControl(), dateOfRetirement: new FormControl(), spouseNameBangla: new FormControl(), spouseName: new FormControl(), @@ -246,6 +247,7 @@ export class GeneralComponent implements OnInit { (resp: any) => { this.hrEmployee = resp; //console.log(this.hrEmployee); + debugger; if (this.hrEmployee.id !== undefined && this.hrEmployee.id !== 0) { this.showEmpImage(); this.userid = undefined; @@ -253,6 +255,7 @@ export class GeneralComponent implements OnInit { emp.employeeID = this.employeeService.hrEmployee.id; emp.employeeNo = this.employeeService.hrEmployee.employeeNo; emp.name = this.employeeService.hrEmployee.name; + //this.employeePhoto = this.employeeService.hrEmployee.photoPath; this.pickerEmployee = emp; if (this.hrEmployee.lineManagerID > 0) { this.getLineManager(); @@ -363,6 +366,7 @@ export class GeneralComponent implements OnInit { this.employeeService.GetuploadEmpFile(this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe( (resp: any) => { if (resp) { + this.employeePhoto = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp}`); } else { this.employeePhoto = this.defaultPhoto; @@ -372,6 +376,26 @@ export class GeneralComponent implements OnInit { (err: any) => { + this.loadingPanel.ShowLoadingPanel = false; + this.notificationService.showError(err.error); + }, + () => { + this.loadingPanel.ShowLoadingPanel = false; + } + ); + this.employeeService.GetuploadEmpFile(this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.signature).subscribe( + (resp: any) => { + if (resp) { + + this.empSigneture = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp}`); + } else { + this.employeePhoto = this.defaultPhoto; + } + + }, + (err: any) => { + + this.loadingPanel.ShowLoadingPanel = false; this.notificationService.showError(err.error); }, @@ -489,6 +513,7 @@ export class GeneralComponent implements OnInit { } saveFile(feferenceID: number, selectedFiles: any, type: enumEmpFileUploadType) { + debugger; if (selectedFiles != undefined && selectedFiles.length > 0) { const file: File | null = selectedFiles.item(0); this.currentFile = file; @@ -587,18 +612,19 @@ export class GeneralComponent implements OnInit { if (confirm('Are you sure change the profile picture? selected picture will be store in database as well as will be used as profile picture.') == false) { return; } - + debugger; this.selectedFiles = event.target.files; if (this.selectedFiles.length > 0) { const file: File | null = this.selectedFiles.item(0); this.currentFile = file; + debugger; this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe( (resp: any) => { console.log('image data'); // console.log(resp.body); - - this.employeePhoto = resp;// this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`); + //this.employeePhoto = resp; + this.employeePhoto = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`); }, (err: any) => { this.notificationService.showError(err.error);