dev_mashfiq #33
|
@ -1309,8 +1309,8 @@ namespace HRM.BO
|
||||||
#endregion
|
#endregion
|
||||||
//CGPA or Marks
|
//CGPA or Marks
|
||||||
#region GPAOrMarks
|
#region GPAOrMarks
|
||||||
private double _gpa;
|
private double? _gpa;
|
||||||
public double GPAOrMarks
|
public double? GPAOrMarks
|
||||||
{
|
{
|
||||||
get { return _gpa; }
|
get { return _gpa; }
|
||||||
set { _gpa = value; }
|
set { _gpa = value; }
|
||||||
|
@ -1319,8 +1319,8 @@ namespace HRM.BO
|
||||||
//OutOf
|
//OutOf
|
||||||
#region Property OutOf : double
|
#region Property OutOf : double
|
||||||
|
|
||||||
private double _outOf;
|
private double? _outOf;
|
||||||
public double OutOf
|
public double? OutOf
|
||||||
{
|
{
|
||||||
get { return _outOf; }
|
get { return _outOf; }
|
||||||
set { _outOf = value; }
|
set { _outOf = value; }
|
||||||
|
|
|
@ -588,8 +588,8 @@ namespace HRM.DA
|
||||||
academic.ID, academic.EmployeeID, academic.EducationLevelID,
|
academic.ID, academic.EmployeeID, academic.EducationLevelID,
|
||||||
DataReader.GetNullValue(academic.DisciplineID, 0), DataReader.GetNullValue(academic.InstitutionID, 0),
|
DataReader.GetNullValue(academic.DisciplineID, 0), DataReader.GetNullValue(academic.InstitutionID, 0),
|
||||||
DataReader.GetNullValue(academic.PassingYear),
|
DataReader.GetNullValue(academic.PassingYear),
|
||||||
DataReader.GetNullValue(academic.ClassOrDivision), academic.GPAOrMarks, academic.LastLevel,
|
DataReader.GetNullValue(academic.ClassOrDivision), DataReader.GetNullValue(academic.GPAOrMarks), academic.LastLevel,
|
||||||
academic.OutOf, DataReader.GetNullValue(academic.ResultTypeID, 0),
|
DataReader.GetNullValue(academic.OutOf), DataReader.GetNullValue(academic.ResultTypeID),
|
||||||
DataReader.GetNullValue(academic.InstituteName), DataReader.GetNullValue(academic.EducationTypeID, 0),
|
DataReader.GetNullValue(academic.InstituteName), DataReader.GetNullValue(academic.EducationTypeID, 0),
|
||||||
academic.PhotoPath, academic.DocSubmissionDate, academic.ProfileStatus);
|
academic.PhotoPath, academic.DocSubmissionDate, academic.ProfileStatus);
|
||||||
}
|
}
|
||||||
|
@ -602,8 +602,8 @@ namespace HRM.DA
|
||||||
" where AcademicID =%n and EmployeeID =%n ", academic.EducationLevelID,
|
" where AcademicID =%n and EmployeeID =%n ", academic.EducationLevelID,
|
||||||
DataReader.GetNullValue(academic.DisciplineID, 0), DataReader.GetNullValue(academic.InstitutionID, 0),
|
DataReader.GetNullValue(academic.DisciplineID, 0), DataReader.GetNullValue(academic.InstitutionID, 0),
|
||||||
DataReader.GetNullValue(academic.PassingYear),
|
DataReader.GetNullValue(academic.PassingYear),
|
||||||
DataReader.GetNullValue(academic.ClassOrDivision), academic.GPAOrMarks, academic.LastLevel,
|
DataReader.GetNullValue(academic.ClassOrDivision), DataReader.GetNullValue(academic.GPAOrMarks), academic.LastLevel,
|
||||||
academic.OutOf, DataReader.GetNullValue(academic.ResultTypeID, 0),
|
DataReader.GetNullValue(academic.OutOf), DataReader.GetNullValue(academic.ResultTypeID),
|
||||||
DataReader.GetNullValue(academic.InstituteName), DataReader.GetNullValue(academic.EducationTypeID, 0),
|
DataReader.GetNullValue(academic.InstituteName), DataReader.GetNullValue(academic.EducationTypeID, 0),
|
||||||
academic.PhotoPath, academic.DocSubmissionDate, academic.ProfileStatus,
|
academic.PhotoPath, academic.DocSubmissionDate, academic.ProfileStatus,
|
||||||
academic.ID, academic.EmployeeID);
|
academic.ID, academic.EmployeeID);
|
||||||
|
|
|
@ -596,8 +596,8 @@ namespace HRM.DA
|
||||||
oEmpAcademic.ProfileStatus = (EnumProfileStatus)oReader.GetInt32("ProfileStatus", 0);
|
oEmpAcademic.ProfileStatus = (EnumProfileStatus)oReader.GetInt32("ProfileStatus", 0);
|
||||||
|
|
||||||
oEmpAcademic.ResultTypeID = oReader.GetInt32("ResultTypeID", 0);
|
oEmpAcademic.ResultTypeID = oReader.GetInt32("ResultTypeID", 0);
|
||||||
oEmpAcademic.GPAOrMarks = oReader.GetDouble("GPAOrMarks", 0);
|
oEmpAcademic.GPAOrMarks = oReader.GetDouble("OutOf").HasValue ? oReader.GetDouble("GPAOrMarks") : null;
|
||||||
oEmpAcademic.OutOf = oReader.GetDouble("OutOf", 0);
|
oEmpAcademic.OutOf = oReader.GetDouble("OutOf").HasValue ? oReader.GetDouble("OutOf") : null;
|
||||||
oEmpAcademic.LastLevel = oReader.GetBoolean("LastLevel", false);
|
oEmpAcademic.LastLevel = oReader.GetBoolean("LastLevel", false);
|
||||||
oEmpAcademic.InstituteName = oReader.GetString("InstituteName");
|
oEmpAcademic.InstituteName = oReader.GetString("InstituteName");
|
||||||
oEmpAcademic.PhotoPath = oReader.GetString("PhotoPath");
|
oEmpAcademic.PhotoPath = oReader.GetString("PhotoPath");
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { EnumLetterOrganizationType } from '../../_models/enums';
|
||||||
import { LetterRequest } from '../../_models/Letter-Request/Letter-Request';
|
import { LetterRequest } from '../../_models/Letter-Request/Letter-Request';
|
||||||
import { AuthorizedPerson } from '../../adhoc-feature/authorized-persons/authorizedPerson';
|
import { AuthorizedPerson } from '../../adhoc-feature/authorized-persons/authorizedPerson';
|
||||||
import { WFMovementTran } from '../../_models/Work-Flow/wFMovementTran';
|
import { WFMovementTran } from '../../_models/Work-Flow/wFMovementTran';
|
||||||
|
import { SearchEmployee } from 'src/app/_models/Employee/searchEmployee';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -233,6 +234,10 @@ export class LetterRequestService {
|
||||||
getImage(id: number) {
|
getImage(id: number) {
|
||||||
return this.apiService.httpGet<any>('/LetterRequest/getImage' + '/' + id);
|
return this.apiService.httpGet<any>('/LetterRequest/getImage' + '/' + id);
|
||||||
}
|
}
|
||||||
|
generatedExceptiinLetter(type: number, param: SearchEmployee[]) {
|
||||||
|
return this.apiService.httpPost('/LetterRequest/generatedExceptiinLetter/' + type , param);
|
||||||
|
// return this.apiService.httpDownloadFile('/LetterRequest/generatedExceptiinLetter/' + type , param);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import {LetterRequestByAdminApprovalComponent} from './letter-request-by-admin-a
|
||||||
import {ApproveFinancialDataComponent} from './approve-financial-data/approve-financial-data.component';
|
import {ApproveFinancialDataComponent} from './approve-financial-data/approve-financial-data.component';
|
||||||
import {AuthorizedPersonsComponent} from './authorized-persons/authorized-persons.component';
|
import {AuthorizedPersonsComponent} from './authorized-persons/authorized-persons.component';
|
||||||
import { LetterGenerateComponent } from './letter-generate/letter-generate.component';
|
import { LetterGenerateComponent } from './letter-generate/letter-generate.component';
|
||||||
|
import { ExceptionLetterGenerateComponent } from './exception-letter-generate/exception-letter-generate.component';
|
||||||
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
|
@ -31,6 +32,7 @@ const routes: Routes = [
|
||||||
{path: 'letter-generate', component: LetterGenerateComponent, canActivate: [AuthGuard]},
|
{path: 'letter-generate', component: LetterGenerateComponent, canActivate: [AuthGuard]},
|
||||||
{path: 'workflow-delegation-by-employee', component: WorkflowDelegationByEmployeeComponent, canActivate: [AuthGuard]},
|
{path: 'workflow-delegation-by-employee', component: WorkflowDelegationByEmployeeComponent, canActivate: [AuthGuard]},
|
||||||
{path: 'delegation-from-admin-panel', component: DelegationFromAdminPanelComponent, canActivate: [AuthGuard]},
|
{path: 'delegation-from-admin-panel', component: DelegationFromAdminPanelComponent, canActivate: [AuthGuard]},
|
||||||
|
{path: 'exception-letter-generate', component: ExceptionLetterGenerateComponent, canActivate: [AuthGuard]},
|
||||||
//{path: 'letter-request-by-employee-and-approval', component: LetterRequestByEmployeeAndApprovalComponent, canActivate: [AuthGuard]},
|
//{path: 'letter-request-by-employee-and-approval', component: LetterRequestByEmployeeAndApprovalComponent, canActivate: [AuthGuard]},
|
||||||
//{path: 'letter-request-approval', component: LetterRequestApprovalComponent, canActivate: [AuthGuard]},
|
//{path: 'letter-request-approval', component: LetterRequestApprovalComponent, canActivate: [AuthGuard]},
|
||||||
//{path: 'letter-print-by-admin-panel', component: LetterPrintByAdminPanelComponent, canActivate: [AuthGuard]},
|
//{path: 'letter-print-by-admin-panel', component: LetterPrintByAdminPanelComponent, canActivate: [AuthGuard]},
|
||||||
|
|
|
@ -49,13 +49,14 @@ import { ApproveFinancialDataComponent } from './approve-financial-data/approve-
|
||||||
import { AuthorizedPersonsComponent } from './authorized-persons/authorized-persons.component';
|
import { AuthorizedPersonsComponent } from './authorized-persons/authorized-persons.component';
|
||||||
import { AuthorizedPersonComponent } from './authorized-persons/authorized-person/authorized-person.component';
|
import { AuthorizedPersonComponent } from './authorized-persons/authorized-person/authorized-person.component';
|
||||||
import { LetterGenerateComponent } from './letter-generate/letter-generate.component';
|
import { LetterGenerateComponent } from './letter-generate/letter-generate.component';
|
||||||
|
import { ExceptionLetterGenerateComponent } from './exception-letter-generate/exception-letter-generate.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
||||||
declarations: [workflowRuleComponent, WorkFlowSetupComponent, WorkFlowSetupNewComponent, WorkFlowAdministrativeStatusComponent,
|
declarations: [workflowRuleComponent, WorkFlowSetupComponent, WorkFlowSetupNewComponent, WorkFlowAdministrativeStatusComponent,
|
||||||
WorkFlowAdminComponent, WorkflowDelegationByEmployeeComponent, DelegationFromAdminPanelComponent,
|
WorkFlowAdminComponent, WorkflowDelegationByEmployeeComponent, DelegationFromAdminPanelComponent,
|
||||||
LetterRequestApprovalComponent, LetterPrintByAdminPanelComponent,
|
LetterRequestApprovalComponent, LetterPrintByAdminPanelComponent,
|
||||||
LetterRequestByAdminApprovalComponent, ApproveFinancialDataComponent, AuthorizedPersonsComponent, AuthorizedPersonComponent, LetterGenerateComponent
|
LetterRequestByAdminApprovalComponent, ApproveFinancialDataComponent, AuthorizedPersonsComponent, AuthorizedPersonComponent, LetterGenerateComponent, ExceptionLetterGenerateComponent
|
||||||
],
|
],
|
||||||
|
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
<app-loading-panel> </app-loading-panel>
|
||||||
|
<div class="card" style="padding:10px;">
|
||||||
|
<div class="p-grid">
|
||||||
|
<div class="p-col-12">
|
||||||
|
<div class="p-grid">
|
||||||
|
<div class="p-col-4 p-md-2">
|
||||||
|
<label>Employee(s)</label>
|
||||||
|
</div>
|
||||||
|
<div class="p-col-8 p-md-4">
|
||||||
|
<!-- <app-employee-picker (ItemSelected)="GetSelectedEmployee($event)" [setSelectedEmp]="selectedEmps"
|
||||||
|
[MultiSelect]="true"></app-employee-picker> -->
|
||||||
|
<app-employee-picker (ItemSelected)="GetSelectedEmployee($event)"
|
||||||
|
[MultiSelect]="true"></app-employee-picker>
|
||||||
|
</div>
|
||||||
|
<div class="p-col-4 p-md-2">
|
||||||
|
<label>Letter</label>
|
||||||
|
</div>
|
||||||
|
<div class="p-col-8 p-md-4">
|
||||||
|
<kendo-dropdownlist [(ngModel)]="selectedreportType" [data]="reportTypes" [textField]="'text'"
|
||||||
|
[valueField]="'value'" [defaultItem]="{ text: 'Select Letter..', value: null }"
|
||||||
|
(valueChange)="onSelectReport($event)">
|
||||||
|
</kendo-dropdownlist>
|
||||||
|
</div>
|
||||||
|
<div class="p-col-12">
|
||||||
|
<kendo-grid #grid [data]="selectedEmps" [kendoGridSelectBy]="'employeeID'" [selectedKeys]="mySelection" [pageable]="false" [sortable]="true" [reorderable]="true"
|
||||||
|
[resizable]="true">
|
||||||
|
<!-- <ng-template kendoGridToolbarTemplate>
|
||||||
|
<button type="button" kendoButton icon="delete" class="kt-delete" (click)="onClickRemoveAll()">
|
||||||
|
Remove All
|
||||||
|
</button>
|
||||||
|
<kendo-grid-spacer></kendo-grid-spacer>
|
||||||
|
<label>Attendance Count: {{employeeList.length}} </label>
|
||||||
|
</ng-template> -->
|
||||||
|
<kendo-grid-checkbox-column [resizable]="false" [width]="45" showSelectAll="true">
|
||||||
|
</kendo-grid-checkbox-column>
|
||||||
|
<kendo-grid-column field="employeeNo" title="Employee No" [width]="150">
|
||||||
|
</kendo-grid-column>
|
||||||
|
<kendo-grid-column field="name" title="Employee Name" [width]="220">
|
||||||
|
</kendo-grid-column>
|
||||||
|
<kendo-grid-column field="departmentName" title="Department" [width]="220">
|
||||||
|
</kendo-grid-column>
|
||||||
|
<kendo-grid-column field="gradeName" title="Grade" [width]="220">
|
||||||
|
</kendo-grid-column>
|
||||||
|
<!-- <kendo-grid-column title="Actions" width="25%" align="middle">
|
||||||
|
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||||
|
<button kendoButton class="kt-delete" icon="delete" style="width: fit-content;"
|
||||||
|
(click)="onClickRemove(dataItem)">Remove</button>
|
||||||
|
</ng-template>
|
||||||
|
</kendo-grid-column> -->
|
||||||
|
</kendo-grid>
|
||||||
|
<div class="p-col-12" align="right">
|
||||||
|
<button kendoButton icon="upload" type="button" (click)="generateLetter()" [primary] = true>Generate</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,162 @@
|
||||||
|
import { error } from 'console';
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { DynamicPicker, EnumDynamicpickerType } from '../../picker/dynamic-picker/Dynamic-Picker';
|
||||||
|
import { SearchEmployee } from 'src/app/_models/Employee/searchEmployee';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { ApiService } from 'src/app/app.api.service';
|
||||||
|
import { HRMNotificationService } from 'src/app/app.notification.service';
|
||||||
|
import { loadingPanelService } from 'src/app/hrm-loding panel/loding.panel.service';
|
||||||
|
import { BasicService } from 'src/app/_services/Basic/basic.service';
|
||||||
|
import { Department } from 'src/app/_models/Basic/department';
|
||||||
|
import { Grade } from 'src/app/_models/Basic/grade';
|
||||||
|
import { EnumStatus } from '../../_models/enums';
|
||||||
|
import { Employee } from 'src/app/_models/Employee/employee';
|
||||||
|
import { LetterRequestService } from 'src/app/_services/letter-request/letter-request.service';
|
||||||
|
import { saveAs } from 'file-saver';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-exception-letter-generate',
|
||||||
|
templateUrl: './exception-letter-generate.component.html',
|
||||||
|
styleUrls: ['./exception-letter-generate.component.scss']
|
||||||
|
})
|
||||||
|
export class ExceptionLetterGenerateComponent implements OnInit {
|
||||||
|
|
||||||
|
public selectedEmps: SearchEmployee[] = [];
|
||||||
|
public mySelection: number[] = [];
|
||||||
|
|
||||||
|
public selectedreportType: EnumExceptionLetterTemplateType;
|
||||||
|
public reportTypes = Object.keys(EnumExceptionLetterTemplateType)
|
||||||
|
.filter(key => !isNaN(Number(EnumExceptionLetterTemplateType[key])))
|
||||||
|
.map(key => ({
|
||||||
|
text: key.replace(/_/g, ' '),
|
||||||
|
value: EnumExceptionLetterTemplateType[key]
|
||||||
|
}));
|
||||||
|
public allDepartments: Department[];
|
||||||
|
public allGrades: Grade[];
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
public router: Router, public loadingPanel: loadingPanelService,
|
||||||
|
public notificationService: HRMNotificationService,
|
||||||
|
public apiService: ApiService,
|
||||||
|
public basicService: BasicService, public letterRequestService: LetterRequestService) {
|
||||||
|
this.apiService.selectedMenuName = 'Employee Letter Generation';
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
// this.basicService.getAllDepartment(EnumStatus.Active).subscribe(
|
||||||
|
// (resp) => {
|
||||||
|
// this.allDepartments = resp;
|
||||||
|
// },
|
||||||
|
// (err: any) => {
|
||||||
|
// this.notificationService.showError(err.error);
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
// this.basicService.getAllGrade(EnumStatus.Active).subscribe(
|
||||||
|
// (resp) => {
|
||||||
|
// this.allGrades = resp;
|
||||||
|
// },
|
||||||
|
// (err: any) => {
|
||||||
|
// this.notificationService.showError(err.error);
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
public GetSelectedEmployee(childData) {
|
||||||
|
this.selectedEmps = childData;
|
||||||
|
// this.selectedEmps.forEach(element => {
|
||||||
|
// element.departmentName = this.allDepartments.find(d => d.id == element.departmentID).name;
|
||||||
|
// element.gradeName = this.allDepartments.find(g => g.id == element.gradeID).name;
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
public onSelectReport(value: any) {
|
||||||
|
debugger;
|
||||||
|
}
|
||||||
|
generateLetter() {
|
||||||
|
let employeeDataToGenerate: SearchEmployee[] = [];
|
||||||
|
this.selectedEmps.forEach(element => {
|
||||||
|
this.mySelection.forEach(item => {
|
||||||
|
if (element.employeeID == item) employeeDataToGenerate.push(element);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.selectedreportType;
|
||||||
|
if (this.selectedreportType == undefined || this.selectedreportType['value'] == null) {
|
||||||
|
this.notificationService.showWarning("Please select a Letter to Generate");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (employeeDataToGenerate.length <= 0) {
|
||||||
|
this.notificationService.showWarning("Please select Employee to Generate Letter");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.loadingPanel.ShowLoadingPanel = true;
|
||||||
|
this.letterRequestService.generatedExceptiinLetter(this.selectedreportType['value'], employeeDataToGenerate).subscribe(
|
||||||
|
(resp: any[]) => {
|
||||||
|
debugger
|
||||||
|
if (resp.length > 0) {
|
||||||
|
resp.forEach(fileData => {
|
||||||
|
// this.downloadBlob(new Blob([fileData.fileContents], { type: 'application/msword' }), 'application/msword', fileData.fileDownloadName);
|
||||||
|
this.downloadFileWord(fileData.fileContents, fileData.fileDownloadName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loadingPanel.ShowLoadingPanel = false;
|
||||||
|
},
|
||||||
|
(err: any) => {
|
||||||
|
this.notificationService.showError(err.error);
|
||||||
|
this.loadingPanel.ShowLoadingPanel = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private downloadBlob(data: any, type: string, fileName: string): void {
|
||||||
|
const blob: Blob = new Blob([data], { type: type });
|
||||||
|
// const fileName: string = this.workOrderBillReceive.UploadAttachment[0].OriginalFileName;
|
||||||
|
// const fileName: string = fileName;
|
||||||
|
const objectUrl: string = URL.createObjectURL(blob);
|
||||||
|
const a: HTMLAnchorElement = document.createElement('a') as HTMLAnchorElement;
|
||||||
|
|
||||||
|
a.href = objectUrl;
|
||||||
|
a.download = fileName;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
|
||||||
|
document.body.removeChild(a);
|
||||||
|
URL.revokeObjectURL(objectUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
downloadFileWord(blobContent, fileName) {
|
||||||
|
// const blob = new Blob([this.b64toBlob(blobContent, 'application/data:application/vnd.openxmlformats-officedocument.wordprocessingml.document', 1024)], {});
|
||||||
|
// saveAs(blob, fileName + '.docx');
|
||||||
|
const blob = new Blob([this.b64toBlob(blobContent, 'application/msword', 1024)], {});
|
||||||
|
saveAs(blob, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
b64toBlob(b64Data, contentType, sliceSize) {
|
||||||
|
const byteCharacters = atob(b64Data);
|
||||||
|
const byteArrays = [];
|
||||||
|
|
||||||
|
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
||||||
|
const slice = byteCharacters.slice(offset, offset + sliceSize);
|
||||||
|
|
||||||
|
const byteNumbers = new Array(slice.length);
|
||||||
|
for (let i = 0; i < slice.length; i++) {
|
||||||
|
byteNumbers[i] = slice.charCodeAt(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
const byteArray = new Uint8Array(byteNumbers);
|
||||||
|
byteArrays.push(byteArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
const blob = new Blob(byteArrays, { type: contentType });
|
||||||
|
return blob;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export enum EnumExceptionLetterTemplateType {
|
||||||
|
Letter_Template_Staff = 1,
|
||||||
|
Letter_Template_Worker = 2
|
||||||
|
}
|
|
@ -55,6 +55,7 @@
|
||||||
|
|
||||||
<div class="card" *ngIf="showPopUp" class="blur-background">
|
<div class="card" *ngIf="showPopUp" class="blur-background">
|
||||||
<kendo-window [height]="600" title="{{PDFTitle}}" *ngIf="showPopUp" (close)="closeForm()" [style]="{'min-width': '70%','max-width': '100%', 'max-height': '100%'}">
|
<kendo-window [height]="600" title="{{PDFTitle}}" *ngIf="showPopUp" (close)="closeForm()" [style]="{'min-width': '70%','max-width': '100%', 'max-height': '100%'}">
|
||||||
|
<app-loading-panel></app-loading-panel>
|
||||||
<div class='embed-responsive'>
|
<div class='embed-responsive'>
|
||||||
<iframe class="pdf-viewer" id="pdf-viewer-ml" type='application/pdf' [zoom]="zoomLevel"></iframe>
|
<iframe class="pdf-viewer" id="pdf-viewer-ml" type='application/pdf' [zoom]="zoomLevel"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -60,6 +60,7 @@ export class LetterGenerateComponent implements OnInit {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
this.showPopUp = true;
|
this.showPopUp = true;
|
||||||
|
this.loadingPanelService.ShowLoadingPanel = true;
|
||||||
this.reportService.getAppointmentLetter(data).subscribe(
|
this.reportService.getAppointmentLetter(data).subscribe(
|
||||||
(resp: any) => {
|
(resp: any) => {
|
||||||
if (this.reportType === 'PDF'){
|
if (this.reportType === 'PDF'){
|
||||||
|
|
|
@ -13,7 +13,7 @@ export class ApiService {
|
||||||
|
|
||||||
public isSSO = false;
|
public isSSO = false;
|
||||||
public versionDeployement = false;
|
public versionDeployement = false;
|
||||||
public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 0, 16))}-`+"01";
|
public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 5))}-`+"01";
|
||||||
public static BASE_URL = '';
|
public static BASE_URL = '';
|
||||||
public base_url = '';
|
public base_url = '';
|
||||||
// public currentLink = '';
|
// public currentLink = '';
|
||||||
|
|
|
@ -11,13 +11,25 @@
|
||||||
<app-employee-picker [MultiSelect]="true"
|
<app-employee-picker [MultiSelect]="true"
|
||||||
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="rosterAssignmentControls">
|
||||||
|
<strong>
|
||||||
|
<label>Roster Type: </label>
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
<div class="rosterAssignmentControls">
|
||||||
|
<kendo-dropdownlist [(ngModel)]="selectedWorkPlanTypeIsFixed" [data]="workPlanTypes"
|
||||||
|
[defaultItem]="{ text: 'Select Roster Type..', value: null }" [textField]="'text'" [valueField]="'value'"
|
||||||
|
(valueChange)="onChangeWorkPlanType($event)" [valuePrimitive]="true"
|
||||||
|
class="form-control form-control-sm input-sm" formControlName="type">
|
||||||
|
</kendo-dropdownlist>
|
||||||
|
</div>
|
||||||
<div class="rosterAssignmentControls">
|
<div class="rosterAssignmentControls">
|
||||||
<strong>
|
<strong>
|
||||||
<label>Roster: </label>
|
<label>Roster: </label>
|
||||||
</strong>
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="rosterAssignmentControls">
|
<div class="rosterAssignmentControls">
|
||||||
<kendo-dropdownlist [(ngModel)]="selectedWorkPlanID" [data]="workPlanGroupList"
|
<kendo-dropdownlist [(ngModel)]="selectedWorkPlanID" [data]="workPlanGroupListByType"
|
||||||
[defaultItem]="{ name: 'Select..', value: null }" [textField]="'name'" [valueField]="'id'"
|
[defaultItem]="{ name: 'Select..', value: null }" [textField]="'name'" [valueField]="'id'"
|
||||||
(valueChange)="populateEmpWorkPlanByWorkGroup($event)" [valuePrimitive]="true"
|
(valueChange)="populateEmpWorkPlanByWorkGroup($event)" [valuePrimitive]="true"
|
||||||
class="form-control form-control-sm input-sm" formControlName="group">
|
class="form-control form-control-sm input-sm" formControlName="group">
|
||||||
|
|
|
@ -31,16 +31,23 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
workPlanGroupName = '';
|
workPlanGroupName = '';
|
||||||
workPlanGroupInitialShift = '';
|
workPlanGroupInitialShift = '';
|
||||||
workPlanGroupList: WorkPlanGroup[];
|
workPlanGroupList: WorkPlanGroup[];
|
||||||
|
workPlanGroupListByType: WorkPlanGroup[] = [];
|
||||||
selectedEmployees: SearchEmployee[];
|
selectedEmployees: SearchEmployee[];
|
||||||
employees: Employee[];
|
employees: Employee[];
|
||||||
empIds: number[] = [];
|
empIds: number[] = [];
|
||||||
exportExcelFileName: string = '';
|
exportExcelFileName: string = '';
|
||||||
|
|
||||||
|
selectedWorkPlanTypeIsFixed: boolean;
|
||||||
selectedWorkPlanID: number;
|
selectedWorkPlanID: number;
|
||||||
fixedWorkPlan: boolean = true;
|
fixedWorkPlan: boolean = true;
|
||||||
startDate: Date;
|
startDate: Date;
|
||||||
holidayDayOfWeekArray = Object.values(HolidayDayOfWeek);
|
holidayDayOfWeekArray = Object.values(HolidayDayOfWeek);
|
||||||
|
|
||||||
|
workPlanTypes: { text: string, value: boolean| null }[] = [
|
||||||
|
{ text: 'Fixed', value: true },
|
||||||
|
{ text: 'Counter Clock', value: false }
|
||||||
|
]
|
||||||
|
|
||||||
constructor(public employeeService: EmployeeServices,
|
constructor(public employeeService: EmployeeServices,
|
||||||
public attendanceServices: AttendanceServices,
|
public attendanceServices: AttendanceServices,
|
||||||
public apiService: ApiService,
|
public apiService: ApiService,
|
||||||
|
@ -85,6 +92,7 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
|
|
||||||
createForm() {
|
createForm() {
|
||||||
this.rosterAssignmentForm = new FormBuilder().group({
|
this.rosterAssignmentForm = new FormBuilder().group({
|
||||||
|
type: ['', Validators.required],
|
||||||
group: ['', Validators.required],
|
group: ['', Validators.required],
|
||||||
startDate: [''],
|
startDate: [''],
|
||||||
});
|
});
|
||||||
|
@ -202,13 +210,13 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
this.loadingPanel.ShowLoadingPanel = true;
|
this.loadingPanel.ShowLoadingPanel = true;
|
||||||
this.empWorkPlanSetupList = [];
|
this.empWorkPlanSetupList = [];
|
||||||
debugger;
|
debugger;
|
||||||
if (workPlanGroup.type != EnumWorkPlanGroup.Fixed &&
|
// if (workPlanGroup.type != EnumWorkPlanGroup.Fixed &&
|
||||||
(workPlanGroup.type != undefined || workPlanGroup.type != null)) {
|
// (workPlanGroup.type != undefined || workPlanGroup.type != null)) {
|
||||||
this.fixedWorkPlan = false;
|
// this.fixedWorkPlan = false;
|
||||||
this.startDate = new Date();
|
// this.startDate = new Date();
|
||||||
} else {
|
// } else {
|
||||||
this.fixedWorkPlan = true;
|
// this.fixedWorkPlan = true;
|
||||||
}
|
// }
|
||||||
this.attendanceServices.getEmployeeWorkPlanSetupByWPGroupID(workPlanGroup.id).subscribe(
|
this.attendanceServices.getEmployeeWorkPlanSetupByWPGroupID(workPlanGroup.id).subscribe(
|
||||||
(resp) => {
|
(resp) => {
|
||||||
this.empWorkPlanSetupList = resp;
|
this.empWorkPlanSetupList = resp;
|
||||||
|
@ -331,7 +339,7 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getHolidayDayOfWeek( day: number): string {
|
public getHolidayDayOfWeek(day: number): string {
|
||||||
debugger;
|
debugger;
|
||||||
day = day + 1;
|
day = day + 1;
|
||||||
switch (day) {
|
switch (day) {
|
||||||
|
@ -365,4 +373,23 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
// return dayIndex as EnumDayOfWeek;
|
// return dayIndex as EnumDayOfWeek;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
onChangeWorkPlanType(type: any) {
|
||||||
|
this.empWorkPlanSetupList = [];
|
||||||
|
this.workPlanGroupListByType = [];
|
||||||
|
this.selectedWorkPlanID = null;
|
||||||
|
this.fixedWorkPlan = true;
|
||||||
|
if (type == undefined || type == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (type){
|
||||||
|
this.workPlanGroupListByType = this.workPlanGroupList.filter(y => y.type == EnumWorkPlanGroup.Fixed);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.workPlanGroupListByType = this.workPlanGroupList.filter(y => y.type != EnumWorkPlanGroup.Fixed);
|
||||||
|
this.fixedWorkPlan = false;
|
||||||
|
this.startDate = new Date();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,16 @@ export class AcademicEntryComponent implements OnInit {
|
||||||
// this.isGrade = false;
|
// this.isGrade = false;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let educationType = this.educationTypes.find(x => x.description.toLowerCase() == "academic");
|
||||||
|
if (this.academic.id == 0 && educationType != undefined) {
|
||||||
|
this.academic.educationTypeID = educationType.id;
|
||||||
|
this.selectedEducationTypeID = this.academic.educationTypeID;
|
||||||
|
this.academic.examDate = new Date().getFullYear();
|
||||||
|
this.academic.passingYear = new Date().getFullYear();
|
||||||
|
this.selectEducationTypeEvent(educationType.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -285,7 +295,7 @@ export class AcademicEntryComponent implements OnInit {
|
||||||
educationLevelPicker: ['', Validators.required],
|
educationLevelPicker: ['', Validators.required],
|
||||||
disciplinePicker: ['', Validators.required],
|
disciplinePicker: ['', Validators.required],
|
||||||
institutionPicker: ['', Validators.required],
|
institutionPicker: ['', Validators.required],
|
||||||
resultTypePicker: ['', Validators.required],
|
resultTypePicker: [''],
|
||||||
examHeldOn: ['', Validators.required],
|
examHeldOn: ['', Validators.required],
|
||||||
passingYear: ['', Validators.required],
|
passingYear: ['', Validators.required],
|
||||||
gpaOrMarks: [''],
|
gpaOrMarks: [''],
|
||||||
|
@ -304,11 +314,12 @@ export class AcademicEntryComponent implements OnInit {
|
||||||
this.selectedResultTypeID = this.academic.resultTypeID;
|
this.selectedResultTypeID = this.academic.resultTypeID;
|
||||||
}
|
}
|
||||||
public onSave(e): void {
|
public onSave(e): void {
|
||||||
|
debugger;
|
||||||
this.academic.educationTypeID = this.selectedEducationTypeID;
|
this.academic.educationTypeID = this.selectedEducationTypeID;
|
||||||
this.academic.educationLevelID = this.selectedEducationLevelID;
|
this.academic.educationLevelID = this.selectedEducationLevelID;
|
||||||
this.academic.institutionID = this.selectedInstitutionID;
|
this.academic.institutionID = this.selectedInstitutionID;
|
||||||
this.academic.disciplineID = this.selectedDisciplineID;
|
this.academic.disciplineID = this.selectedDisciplineID;
|
||||||
this.academic.resultTypeID = this.selectedResultTypeID;
|
this.academic.resultTypeID = this.selectedResultTypeID != null ? this.selectedResultTypeID : 0;
|
||||||
if (this.employeeService.hrEmployee.id === undefined || this.employeeService.hrEmployee.id === 0) {
|
if (this.employeeService.hrEmployee.id === undefined || this.employeeService.hrEmployee.id === 0) {
|
||||||
this.notificationService.showWarning('please select an employee');
|
this.notificationService.showWarning('please select an employee');
|
||||||
this.onCancel(null);
|
this.onCancel(null);
|
||||||
|
@ -320,10 +331,9 @@ export class AcademicEntryComponent implements OnInit {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.academic.createdBy = 0;
|
|
||||||
this.academic.employeeID = this.employeeService.hrEmployee.id;
|
this.academic.employeeID = this.employeeService.hrEmployee.id;
|
||||||
this.academic.createdDate = new Date(this.academic.createdBy);
|
|
||||||
this.academic.createdBy = 0;
|
this.academic.createdBy = 0;
|
||||||
|
this.academic.createdDate = new Date();
|
||||||
this.loadingPanelService.ShowLoadingPanel = true;
|
this.loadingPanelService.ShowLoadingPanel = true;
|
||||||
this.employeeService.saveEmployeeAcademic(this.academic).subscribe(
|
this.employeeService.saveEmployeeAcademic(this.academic).subscribe(
|
||||||
(resp) => {
|
(resp) => {
|
||||||
|
|
|
@ -104,10 +104,10 @@ export class ContactComponent implements OnInit {
|
||||||
contactOfficialEmail: new FormControl(''),
|
contactOfficialEmail: new FormControl(''),
|
||||||
contactFax: new FormControl(''),
|
contactFax: new FormControl(''),
|
||||||
|
|
||||||
emergencyContactPerson: new FormControl('', Validators.required),
|
emergencyContactPerson: new FormControl(''),
|
||||||
emergencyAddress: new FormControl('', Validators.required),
|
emergencyAddress: new FormControl(''),
|
||||||
emergencyLandPhone: new FormControl(''),
|
emergencyLandPhone: new FormControl(''),
|
||||||
emergencyMobileNo: new FormControl('', Validators.required),
|
emergencyMobileNo: new FormControl(''),
|
||||||
relation: new FormControl(''),
|
relation: new FormControl(''),
|
||||||
|
|
||||||
presentPOInBangla: new FormControl(''),
|
presentPOInBangla: new FormControl(''),
|
||||||
|
|
|
@ -27,7 +27,9 @@
|
||||||
|
|
||||||
<p-tabView [scrollable]="true">
|
<p-tabView [scrollable]="true">
|
||||||
<p-tabPanel header="General" leftIcon="pi pi-user">
|
<p-tabPanel header="General" leftIcon="pi pi-user">
|
||||||
<app-general [isActive]="!newEmployee" [employeeNo]="this.employeeService.hrEmployee.employeeNo"></app-general>
|
<app-general [isActive]="!newEmployee" [employeeNo]="this.employeeService.hrEmployee.employeeNo"
|
||||||
|
(defaultNationalityHandler)="defaultNationalityHandler($event)"
|
||||||
|
(defaultEmployeeTypeHandler)="defaultEmployeeTypeHandler($event)"></app-general>
|
||||||
</p-tabPanel>
|
</p-tabPanel>
|
||||||
<p-tabPanel header="Contacts" leftIcon="pi pi-phone">
|
<p-tabPanel header="Contacts" leftIcon="pi pi-phone">
|
||||||
<app-contact (saveContact)="saveContact($event)"></app-contact>
|
<app-contact (saveContact)="saveContact($event)"></app-contact>
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
import {Component, OnInit} from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import {EmployeeServices} from '../../_services/employee/employee.service';
|
import { EmployeeServices } from '../../_services/employee/employee.service';
|
||||||
import {empFileuploads, HrEmployee} from '../../_models/HREmployee/hrEmployee';
|
import { empFileuploads, HrEmployee } from '../../_models/HREmployee/hrEmployee';
|
||||||
import {SearchEmployee} from '../../_models/Employee/searchEmployee';
|
import { SearchEmployee } from '../../_models/Employee/searchEmployee';
|
||||||
import {DataTransferService} from '../../data.transfer.service';
|
import { DataTransferService } from '../../data.transfer.service';
|
||||||
import {BasicService} from '../../_services/Basic/basic.service';
|
import { BasicService } from '../../_services/Basic/basic.service';
|
||||||
import {enumEmpFileUploadType, EnumExtension, EnumGender, EnumStatus} from '../../_models/enums';
|
import { enumEmpFileUploadType, EnumExtension, EnumGender, EnumStatus } from '../../_models/enums';
|
||||||
import {EmpContact} from '../../_models/HREmployee/empContact';
|
import { EmpContact } from '../../_models/HREmployee/empContact';
|
||||||
import {ApiService} from '../../app.api.service';
|
import { ApiService } from '../../app.api.service';
|
||||||
import {loadingPanelService} from '../../hrm-loding panel/loding.panel.service';
|
import { loadingPanelService } from '../../hrm-loding panel/loding.panel.service';
|
||||||
import {HRMNotificationService} from '../../app.notification.service';
|
import { HRMNotificationService } from '../../app.notification.service';
|
||||||
import {DomSanitizer} from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
import { Nationality } from '../nationality/nationality';
|
||||||
|
import { Category } from 'src/app/_models/Basic/category';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-employee-profile',
|
selector: 'app-employee-profile',
|
||||||
|
@ -30,6 +32,8 @@ export class EmployeeProfileComponent implements OnInit {
|
||||||
attachment: any;
|
attachment: any;
|
||||||
fileType = '';
|
fileType = '';
|
||||||
isDisplay = false;
|
isDisplay = false;
|
||||||
|
defaultNationality: Nationality;
|
||||||
|
defaultEmployeeType: Category;
|
||||||
constructor(private fb: FormBuilder,
|
constructor(private fb: FormBuilder,
|
||||||
public employeeService: EmployeeServices,
|
public employeeService: EmployeeServices,
|
||||||
public basicService: BasicService,
|
public basicService: BasicService,
|
||||||
|
@ -261,6 +265,12 @@ export class EmployeeProfileComponent implements OnInit {
|
||||||
this.employeeService.hrEmployee.passportExpDate = new Date(this.employeeService.hrEmployee.passportExpDate);
|
this.employeeService.hrEmployee.passportExpDate = new Date(this.employeeService.hrEmployee.passportExpDate);
|
||||||
this.employeeService.hrEmployee.passportIssueDate = new Date(this.employeeService.hrEmployee.passportIssueDate);
|
this.employeeService.hrEmployee.passportIssueDate = new Date(this.employeeService.hrEmployee.passportIssueDate);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.hrEmployeeProfile.birthDate = new Date();
|
||||||
|
this.hrEmployeeProfile.joiningDate = new Date();
|
||||||
|
this.hrEmployeeProfile.nationalityID = this.defaultNationality != null ? this.defaultNationality.id : null;
|
||||||
|
this.hrEmployeeProfile.categoryID = this.defaultEmployeeType != null ? this.defaultEmployeeType.id : null;
|
||||||
|
}
|
||||||
this.employeeService.Employee_Get_Completed.next(this.hrEmployeeProfile);
|
this.employeeService.Employee_Get_Completed.next(this.hrEmployeeProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,12 +302,12 @@ export class EmployeeProfileComponent implements OnInit {
|
||||||
this.contact = item;
|
this.contact = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
editHandler({dataItem}) {
|
editHandler({ dataItem }) {
|
||||||
this.isDisplay = true;
|
this.isDisplay = true;
|
||||||
const item = dataItem as empFileuploads;
|
const item = dataItem as empFileuploads;
|
||||||
this.attachment = item.fileData;
|
this.attachment = item.fileData;
|
||||||
const type = item.fileName.split('.').pop();
|
const type = item.fileName.split('.').pop();
|
||||||
if ( type === 'png' || type === 'jpg' || type === 'jpeg') {
|
if (type === 'png' || type === 'jpg' || type === 'jpeg') {
|
||||||
this.fileType = 'image';
|
this.fileType = 'image';
|
||||||
}
|
}
|
||||||
else if (type === 'pdf') {
|
else if (type === 'pdf') {
|
||||||
|
@ -308,5 +318,12 @@ export class EmployeeProfileComponent implements OnInit {
|
||||||
onPopUpClose() {
|
onPopUpClose() {
|
||||||
this.isDisplay = false;
|
this.isDisplay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultNationalityHandler(dataItem: Nationality) {
|
||||||
|
this.defaultNationality = dataItem;
|
||||||
|
}
|
||||||
|
defaultEmployeeTypeHandler(dataItem: Category) {
|
||||||
|
this.defaultEmployeeType = dataItem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ export class ChildrenListComponent implements OnInit {
|
||||||
addNew() {
|
addNew() {
|
||||||
this.editIndex = -1;
|
this.editIndex = -1;
|
||||||
this.empChildren = new EmpChildren();
|
this.empChildren = new EmpChildren();
|
||||||
|
this.empChildren.birthDate = new Date();
|
||||||
this.isDisplay = true;
|
this.isDisplay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ export class SpouseListComponent implements OnInit {
|
||||||
addNew() {
|
addNew() {
|
||||||
this.editIndex = -1;
|
this.editIndex = -1;
|
||||||
this.empSpouse = new EmpSpouse();
|
this.empSpouse = new EmpSpouse();
|
||||||
|
this.empSpouse.marriageDate = new Date();
|
||||||
this.isDisplay = true;
|
this.isDisplay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { DataTransferService } from '../../../data.transfer.service';
|
import { DataTransferService } from '../../../data.transfer.service';
|
||||||
import { EmployeeServices } from '../../../_services/employee/employee.service';
|
import { EmployeeServices } from '../../../_services/employee/employee.service';
|
||||||
|
@ -115,6 +115,7 @@ export class GeneralComponent implements OnInit {
|
||||||
pickerEmployee: SearchEmployee;
|
pickerEmployee: SearchEmployee;
|
||||||
nationalities: Nationality[];
|
nationalities: Nationality[];
|
||||||
defaultNationality: Nationality;
|
defaultNationality: Nationality;
|
||||||
|
defaultEmployeeType: Category;
|
||||||
nameBangla: string = 'asasas';
|
nameBangla: string = 'asasas';
|
||||||
defaultPhoto = "assets/photos/profile-default.jpg";
|
defaultPhoto = "assets/photos/profile-default.jpg";
|
||||||
photoPath = "Documents/EMPPHOTO";
|
photoPath = "Documents/EMPPHOTO";
|
||||||
|
@ -126,6 +127,8 @@ export class GeneralComponent implements OnInit {
|
||||||
permanentThanas: Thana[];
|
permanentThanas: Thana[];
|
||||||
|
|
||||||
isAccessCard: boolean = false;
|
isAccessCard: boolean = false;
|
||||||
|
@Output() defaultNationalityHandler = new EventEmitter<Nationality>();
|
||||||
|
@Output() defaultEmployeeTypeHandler = new EventEmitter<Category>();
|
||||||
|
|
||||||
constructor(public employeeService: EmployeeServices, public basicService: BasicService,
|
constructor(public employeeService: EmployeeServices, public basicService: BasicService,
|
||||||
public notificationService: HRMNotificationService,
|
public notificationService: HRMNotificationService,
|
||||||
|
@ -156,6 +159,11 @@ export class GeneralComponent implements OnInit {
|
||||||
|
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
|
this.defaultEmployeeType = this.employeeTypes.find(x => x.name.toLowerCase() == "worker");
|
||||||
|
if (this.defaultEmployeeType != undefined) {
|
||||||
|
// this.hrEmployee.categoryID = this.defaultEmployeeType.id;
|
||||||
|
this.defaultEmployeeTypeHandler.emit(this.defaultEmployeeType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -178,7 +186,8 @@ export class GeneralComponent implements OnInit {
|
||||||
() => {
|
() => {
|
||||||
this.defaultNationality = this.nationalities.find(x => x.description.toLowerCase() == "bangladeshi");
|
this.defaultNationality = this.nationalities.find(x => x.description.toLowerCase() == "bangladeshi");
|
||||||
if (this.defaultNationality) {
|
if (this.defaultNationality) {
|
||||||
this.hrEmployee.nationalityID = this.defaultNationality.id;
|
// this.hrEmployee.nationalityID = this.defaultNationality.id;
|
||||||
|
this.defaultNationalityHandler.emit(this.defaultNationality);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -460,7 +469,7 @@ export class GeneralComponent implements OnInit {
|
||||||
// }
|
// }
|
||||||
this.employeeService.saveHrPersonalInfo(this.hrEmployee).subscribe(
|
this.employeeService.saveHrPersonalInfo(this.hrEmployee).subscribe(
|
||||||
(resp: HrEmployee) => {
|
(resp: HrEmployee) => {
|
||||||
if(resp != undefined){
|
if (resp != undefined) {
|
||||||
this.hrEmployee.id = resp.id;
|
this.hrEmployee.id = resp.id;
|
||||||
if (this.active == false) {
|
if (this.active == false) {
|
||||||
this.hrEmployee.employeeNo = resp.employeeNo;
|
this.hrEmployee.employeeNo = resp.employeeNo;
|
||||||
|
|
|
@ -86,6 +86,7 @@ export class NomineeListComponent implements OnInit {
|
||||||
this.editIndex = -1;
|
this.editIndex = -1;
|
||||||
this.nominee = new EmpNominee();
|
this.nominee = new EmpNominee();
|
||||||
this.nominee.employeeID = this.employeeService.hrEmployee.id;
|
this.nominee.employeeID = this.employeeService.hrEmployee.id;
|
||||||
|
this.nominee.percentage = 100;
|
||||||
this.isDisplay = true;
|
this.isDisplay = true;
|
||||||
}
|
}
|
||||||
public editHandler(rowIndex: any) {
|
public editHandler(rowIndex: any) {
|
||||||
|
|
|
@ -11,11 +11,13 @@ using AutoMapper.Configuration;
|
||||||
using Google.Protobuf.WellKnownTypes;
|
using Google.Protobuf.WellKnownTypes;
|
||||||
using HRM.BO;
|
using HRM.BO;
|
||||||
using HRM.DA;
|
using HRM.DA;
|
||||||
|
using HRM.Report;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.StaticFiles;
|
using Microsoft.AspNetCore.StaticFiles;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using NPOI.HPSF;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
using Org.BouncyCastle.Ocsp;
|
using Org.BouncyCastle.Ocsp;
|
||||||
using static HRM.Report.PayrollDataSet.PayrollDataSet;
|
using static HRM.Report.PayrollDataSet.PayrollDataSet;
|
||||||
|
@ -783,6 +785,88 @@ namespace HRM.UI.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost("generatedExceptiinLetter/{letterType}")]
|
||||||
|
public ActionResult generatedExceptiinLetter(int letterType, List<SearchEmployee> employees)
|
||||||
|
{
|
||||||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||||
|
int payrollTypeId = currentUser.PayrollTypeID.GetValueOrDefault();
|
||||||
|
//string downloadPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads";
|
||||||
|
string downloadPath = System.Environment.CurrentDirectory + "\\Documents\\LetterTempFolder\\";
|
||||||
|
string lFileName = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
//List<string> sFilePaths = new List<string>();
|
||||||
|
List<Tuple<byte[], string, string>> filesWithContents = new List<Tuple<byte[], string, string>>();
|
||||||
|
List<FileContentResult> files = new List<FileContentResult>();
|
||||||
|
|
||||||
|
LetterTemplte ltemplate = new LetterTemplte();
|
||||||
|
|
||||||
|
byte[] bytes = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
if (letterType == 1)
|
||||||
|
{
|
||||||
|
ltemplate.SetObjectID(FixedLetterTemplte.Staff_Appointment_Letter);
|
||||||
|
|
||||||
|
ltemplate.ID = 2;
|
||||||
|
ltemplate.Description = "Letter Template Staff";
|
||||||
|
ltemplate.Subject = "Letter Template Staff";
|
||||||
|
ltemplate.Type = EnumDocType.Desktop_Letter;
|
||||||
|
ltemplate.TypeID = (int)EnumDocType.Desktop_Letter;
|
||||||
|
|
||||||
|
lFileName = "Staff.doc";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ltemplate.SetObjectID(FixedLetterTemplte.Worker_Appointment_Letter);
|
||||||
|
|
||||||
|
ltemplate.ID = 3;
|
||||||
|
ltemplate.Description = "Letter Template Worker";
|
||||||
|
ltemplate.Subject = "Letter Template Worker";
|
||||||
|
ltemplate.Type = EnumDocType.Desktop_Letter;
|
||||||
|
ltemplate.TypeID = (int)EnumDocType.Desktop_Letter;
|
||||||
|
|
||||||
|
lFileName = "Worker.doc";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (employees != null && employees.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var emp in employees)
|
||||||
|
{
|
||||||
|
string sFilePath = new rptEmployee().Generate(ltemplate, emp.EmployeeID, payrollTypeId, downloadPath, lFileName);
|
||||||
|
byte[] buffer = new byte[16 * 1024];
|
||||||
|
buffer = System.IO.File.ReadAllBytes(sFilePath);
|
||||||
|
string contentType = GetFileType(sFilePath);
|
||||||
|
var name = lFileName;
|
||||||
|
if (System.IO.File.Exists(sFilePath))
|
||||||
|
{
|
||||||
|
System.IO.File.Delete(sFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
//sFilePaths.Add(sFilePath);
|
||||||
|
filesWithContents.Add(new Tuple<byte[], string, string>(buffer, emp.EmployeeNo + "_" + name, contentType));
|
||||||
|
|
||||||
|
var file = File(buffer, contentType, emp.EmployeeNo + "_" + name);
|
||||||
|
//return file;
|
||||||
|
files.Add(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//return Ok(filesWithContents);
|
||||||
|
return Ok(files);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user