Merge pull request 'Pro Pic Sign' (#30) from dev_chapal into devqc
Reviewed-on: http://103.197.204.162:3025/CelHRTeam/EchoTex_Payroll/pulls/30
BIN
HRM.UI/ClientApp/src/Documents/EMPPHOTO/Image-3.jpg
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
HRM.UI/ClientApp/src/Documents/EMPPHOTO/Signature-3.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
|
@ -367,6 +367,12 @@ export class EmployeeServices {
|
||||||
|
|
||||||
return this.apiService.httpGet<any>('/Employee/GetuploadEmpFile' + '/' + empid + '/' + referenceid + '/' + filetype);
|
return this.apiService.httpGet<any>('/Employee/GetuploadEmpFile' + '/' + empid + '/' + referenceid + '/' + filetype);
|
||||||
}
|
}
|
||||||
|
GetEmpImageSignFile(empid: number, referenceid: number, filetype: number):
|
||||||
|
Observable<HttpEvent<any>> {
|
||||||
|
|
||||||
|
return this.apiService.httpGet<any>('/Employee/GetEmpImageSignFile' + '/' + empid + '/' + referenceid + '/' + filetype);
|
||||||
|
}
|
||||||
|
|
||||||
GetCompanyImage(): Observable<HttpEvent<any>>{
|
GetCompanyImage(): Observable<HttpEvent<any>>{
|
||||||
return this.apiService.httpGet<any>('/Employee/GetCompanyImage');
|
return this.apiService.httpGet<any>('/Employee/GetCompanyImage');
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,7 @@ export class GeneralComponent implements OnInit {
|
||||||
defaultNationality: Nationality;
|
defaultNationality: Nationality;
|
||||||
nameBangla: string = 'asasas';
|
nameBangla: string = 'asasas';
|
||||||
defaultPhoto = "assets/photos/profile-default.jpg";
|
defaultPhoto = "assets/photos/profile-default.jpg";
|
||||||
|
photoPath = "Documents/EMPPHOTO";
|
||||||
isDisplay: boolean = false;
|
isDisplay: boolean = false;
|
||||||
|
|
||||||
contactForm: FormGroup;
|
contactForm: FormGroup;
|
||||||
|
@ -135,6 +136,7 @@ export class GeneralComponent implements OnInit {
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.employeePhoto = this.defaultPhoto;
|
this.employeePhoto = this.defaultPhoto;
|
||||||
|
this.empSigneture = "";
|
||||||
this.basicService.getAllReligion().subscribe(
|
this.basicService.getAllReligion().subscribe(
|
||||||
(resp: any) => {
|
(resp: any) => {
|
||||||
this.religions = resp;
|
this.religions = resp;
|
||||||
|
@ -265,6 +267,7 @@ export class GeneralComponent implements OnInit {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.employeePhoto = this.defaultPhoto;
|
this.employeePhoto = this.defaultPhoto;
|
||||||
|
this.empSigneture = "";
|
||||||
// this.employeeService.generateEmployeeNo().subscribe(
|
// this.employeeService.generateEmployeeNo().subscribe(
|
||||||
// (resp) => {
|
// (resp) => {
|
||||||
// this.hrEmployee.employeeNo = resp as string;
|
// this.hrEmployee.employeeNo = resp as string;
|
||||||
|
@ -362,11 +365,15 @@ export class GeneralComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public showEmpImage() {
|
public showEmpImage() {
|
||||||
|
debugger;
|
||||||
this.loadingPanel.ShowLoadingPanel = true;
|
this.loadingPanel.ShowLoadingPanel = true;
|
||||||
this.employeeService.GetuploadEmpFile(this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe(
|
this.empSigneture = "";
|
||||||
|
this.employeePhoto = this.defaultPhoto;
|
||||||
|
//this.employeePhoto = this.photoPath + "/" + "Image-" + this.hrEmployee.employeeNo + ".jpg";
|
||||||
|
this.employeeService.GetEmpImageSignFile(this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.Profile_Picture).subscribe(
|
||||||
(resp: any) => {
|
(resp: any) => {
|
||||||
if (resp) {
|
if (resp) {
|
||||||
|
|
||||||
this.employeePhoto = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp}`);
|
this.employeePhoto = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp}`);
|
||||||
} else {
|
} else {
|
||||||
this.employeePhoto = this.defaultPhoto;
|
this.employeePhoto = this.defaultPhoto;
|
||||||
|
@ -383,7 +390,7 @@ export class GeneralComponent implements OnInit {
|
||||||
this.loadingPanel.ShowLoadingPanel = false;
|
this.loadingPanel.ShowLoadingPanel = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.employeeService.GetuploadEmpFile(this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.signature).subscribe(
|
this.employeeService.GetEmpImageSignFile(this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.signature).subscribe(
|
||||||
(resp: any) => {
|
(resp: any) => {
|
||||||
if (resp) {
|
if (resp) {
|
||||||
|
|
||||||
|
@ -861,6 +868,7 @@ export class GeneralComponent implements OnInit {
|
||||||
this.currentFile = file;
|
this.currentFile = file;
|
||||||
this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.signature).subscribe(
|
this.employeeService.uploadEmpFile(this.currentFile, this.hrEmployee.id, this.hrEmployee.id, enumEmpFileUploadType.signature).subscribe(
|
||||||
(resp: any) => {
|
(resp: any) => {
|
||||||
|
this.empSigneture = this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`);
|
||||||
// console.log(resp.body);
|
// console.log(resp.body);
|
||||||
//this.Sigfiles = resp;// this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`);
|
//this.Sigfiles = resp;// this.sanitizer.bypassSecurityTrustResourceUrl(`data:image/png;base64, ${resp.body}`);
|
||||||
},
|
},
|
||||||
|
|
BIN
HRM.UI/ClientApp/src/assets/EMPPHOTO/391_BP0007_1.jpg
Normal file
After Width: | Height: | Size: 2.0 MiB |
BIN
HRM.UI/ClientApp/src/assets/EMPPHOTO/713_BP1199_1.jpg
Normal file
After Width: | Height: | Size: 99 KiB |
BIN
HRM.UI/ClientApp/src/assets/EMPPHOTO/713_S3898_1.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
HRM.UI/ClientApp/src/assets/EMPPHOTO/Image-3.jpg
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
HRM.UI/ClientApp/src/assets/EMPPHOTO/Signature-3.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
|
@ -1566,11 +1566,11 @@ namespace HRM.UI.Controllers
|
||||||
//this._hrEmployeeService.uplaodFile(item);
|
//this._hrEmployeeService.uplaodFile(item);
|
||||||
base64String = Convert.ToBase64String(textAsBytes);
|
base64String = Convert.ToBase64String(textAsBytes);
|
||||||
}
|
}
|
||||||
if (directoryUpload)
|
if (directoryUpload || item.filetype== enumEmpFileUploadType.photo || item.filetype == enumEmpFileUploadType.signature)
|
||||||
{
|
{
|
||||||
PhotoPath photoPath = new PhotoPathService().Get().FirstOrDefault();
|
PhotoPath photoPath = new PhotoPathService().Get().FirstOrDefault();
|
||||||
string employeeNo = (new EmployeeService().Get(item.employeeID)).EmployeeNo;
|
string employeeNo = (new EmployeeService().Get(item.employeeID)).EmployeeNo;
|
||||||
string TargetFolder = photoPath.EmployeePhoto;
|
string TargetFolder = @"Documents\EMPPHOTO\";
|
||||||
if (photoPath != null)
|
if (photoPath != null)
|
||||||
{
|
{
|
||||||
string newFileName = "";
|
string newFileName = "";
|
||||||
|
@ -1715,6 +1715,47 @@ namespace HRM.UI.Controllers
|
||||||
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[HttpGet("GetEmpImageSignFile/{empid}/{referenceid}/{filetype}")]
|
||||||
|
public ActionResult GetEmpImageSignFile(int empid, int referenceid, enumEmpFileUploadType filetype)
|
||||||
|
{
|
||||||
|
empFileupload item = new empFileupload();
|
||||||
|
string employeeNo = (new EmployeeService().Get(empid)).EmployeeNo;
|
||||||
|
string TargetFolder = @"Documents\EMPPHOTO\";
|
||||||
|
|
||||||
|
string newFileName = "";
|
||||||
|
switch (filetype)
|
||||||
|
{
|
||||||
|
case enumEmpFileUploadType.photo:
|
||||||
|
newFileName = string.Format("Image-{0}.jpg", employeeNo);
|
||||||
|
break;
|
||||||
|
case enumEmpFileUploadType.signature:
|
||||||
|
newFileName = string.Format("Signature-{0}.jpg", employeeNo);
|
||||||
|
break;
|
||||||
|
//case enumEmpFileUploadType.NomineePicture:
|
||||||
|
// newFileName = string.Format("Image-{0}.jpg", employeeNo);
|
||||||
|
// break;
|
||||||
|
//case enumEmpFileUploadType.NomineeSignature:
|
||||||
|
// newFileName = string.Format("Image-{0}.jpg", employeeNo);
|
||||||
|
// break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
string imagePath = TargetFolder+ newFileName;
|
||||||
|
|
||||||
|
if (System.IO.File.Exists(imagePath))
|
||||||
|
{
|
||||||
|
byte[] textAsBytes = System.IO.File.ReadAllBytes(imagePath);
|
||||||
|
string base64String = "";
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
base64String = Convert.ToBase64String(textAsBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(base64String);
|
||||||
|
}
|
||||||
|
else return Ok("");
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("GetuploadEmpFile/{empid}/{referenceid}/{filetype}")]
|
[HttpGet("GetuploadEmpFile/{empid}/{referenceid}/{filetype}")]
|
||||||
public ActionResult GetuploadEmpFile(int empid, int referenceid, enumEmpFileUploadType filetype)
|
public ActionResult GetuploadEmpFile(int empid, int referenceid, enumEmpFileUploadType filetype)
|
||||||
|
|
BIN
HRM.UI/Documents/EMPPHOTO/Image-100.jpg
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
HRM.UI/Documents/EMPPHOTO/Image-3.jpg
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
HRM.UI/Documents/EMPPHOTO/Signature-100.jpg
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
HRM.UI/Documents/EMPPHOTO/Signature-3.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
HRM.UI/EMPPHOTO/Image-3.jpg
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
HRM.UI/EMPPHOTO/Signature-3.jpg
Normal file
After Width: | Height: | Size: 11 KiB |