From f418e7ab3d8125e8e3a66885086ab021731f6070 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Tue, 4 Feb 2025 12:12:16 +0600 Subject: [PATCH 1/9] employee profile issues upon client requirement --- HRM.BO/HREmployee/HREmployee.cs | 8 +-- HRM.DA/DA/HREmployee/HREmployeeDA.cs | 8 +-- .../Service/HREmployee/HREmployeeService.cs | 4 +- .../academic-entry.component.ts | 18 +++++-- .../contact/contact.component.ts | 6 +-- .../employee-profile.component.html | 2 +- .../employee-profile.component.ts | 51 +++++++++++-------- .../general/general.component.ts | 4 +- 8 files changed, 62 insertions(+), 39 deletions(-) diff --git a/HRM.BO/HREmployee/HREmployee.cs b/HRM.BO/HREmployee/HREmployee.cs index 37c0921..5fc00d4 100644 --- a/HRM.BO/HREmployee/HREmployee.cs +++ b/HRM.BO/HREmployee/HREmployee.cs @@ -1309,8 +1309,8 @@ namespace HRM.BO #endregion //CGPA or Marks #region GPAOrMarks - private double _gpa; - public double GPAOrMarks + private double? _gpa; + public double? GPAOrMarks { get { return _gpa; } set { _gpa = value; } @@ -1319,8 +1319,8 @@ namespace HRM.BO //OutOf #region Property OutOf : double - private double _outOf; - public double OutOf + private double? _outOf; + public double? OutOf { get { return _outOf; } set { _outOf = value; } diff --git a/HRM.DA/DA/HREmployee/HREmployeeDA.cs b/HRM.DA/DA/HREmployee/HREmployeeDA.cs index d481f42..b05dcd4 100644 --- a/HRM.DA/DA/HREmployee/HREmployeeDA.cs +++ b/HRM.DA/DA/HREmployee/HREmployeeDA.cs @@ -588,8 +588,8 @@ namespace HRM.DA academic.ID, academic.EmployeeID, academic.EducationLevelID, DataReader.GetNullValue(academic.DisciplineID, 0), DataReader.GetNullValue(academic.InstitutionID, 0), DataReader.GetNullValue(academic.PassingYear), - DataReader.GetNullValue(academic.ClassOrDivision), academic.GPAOrMarks, academic.LastLevel, - academic.OutOf, DataReader.GetNullValue(academic.ResultTypeID, 0), + DataReader.GetNullValue(academic.ClassOrDivision), DataReader.GetNullValue(academic.GPAOrMarks), academic.LastLevel, + DataReader.GetNullValue(academic.OutOf), DataReader.GetNullValue(academic.ResultTypeID), DataReader.GetNullValue(academic.InstituteName), DataReader.GetNullValue(academic.EducationTypeID, 0), academic.PhotoPath, academic.DocSubmissionDate, academic.ProfileStatus); } @@ -602,8 +602,8 @@ namespace HRM.DA " where AcademicID =%n and EmployeeID =%n ", academic.EducationLevelID, DataReader.GetNullValue(academic.DisciplineID, 0), DataReader.GetNullValue(academic.InstitutionID, 0), DataReader.GetNullValue(academic.PassingYear), - DataReader.GetNullValue(academic.ClassOrDivision), academic.GPAOrMarks, academic.LastLevel, - academic.OutOf, DataReader.GetNullValue(academic.ResultTypeID, 0), + DataReader.GetNullValue(academic.ClassOrDivision), DataReader.GetNullValue(academic.GPAOrMarks), academic.LastLevel, + DataReader.GetNullValue(academic.OutOf), DataReader.GetNullValue(academic.ResultTypeID), DataReader.GetNullValue(academic.InstituteName), DataReader.GetNullValue(academic.EducationTypeID, 0), academic.PhotoPath, academic.DocSubmissionDate, academic.ProfileStatus, academic.ID, academic.EmployeeID); diff --git a/HRM.DA/Service/HREmployee/HREmployeeService.cs b/HRM.DA/Service/HREmployee/HREmployeeService.cs index daf95fc..e9f9459 100644 --- a/HRM.DA/Service/HREmployee/HREmployeeService.cs +++ b/HRM.DA/Service/HREmployee/HREmployeeService.cs @@ -596,8 +596,8 @@ namespace HRM.DA oEmpAcademic.ProfileStatus = (EnumProfileStatus)oReader.GetInt32("ProfileStatus", 0); oEmpAcademic.ResultTypeID = oReader.GetInt32("ResultTypeID", 0); - oEmpAcademic.GPAOrMarks = oReader.GetDouble("GPAOrMarks", 0); - oEmpAcademic.OutOf = oReader.GetDouble("OutOf", 0); + oEmpAcademic.GPAOrMarks = oReader.GetDouble("OutOf").HasValue ? oReader.GetDouble("GPAOrMarks") : null; + oEmpAcademic.OutOf = oReader.GetDouble("OutOf").HasValue ? oReader.GetDouble("OutOf") : null; oEmpAcademic.LastLevel = oReader.GetBoolean("LastLevel", false); oEmpAcademic.InstituteName = oReader.GetString("InstituteName"); oEmpAcademic.PhotoPath = oReader.GetString("PhotoPath"); diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.ts index 33c3221..06299d9 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.ts @@ -187,6 +187,16 @@ export class AcademicEntryComponent implements OnInit { // 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], disciplinePicker: ['', Validators.required], institutionPicker: ['', Validators.required], - resultTypePicker: ['', Validators.required], + resultTypePicker: [''], examHeldOn: ['', Validators.required], passingYear: ['', Validators.required], gpaOrMarks: [''], @@ -304,11 +314,12 @@ export class AcademicEntryComponent implements OnInit { this.selectedResultTypeID = this.academic.resultTypeID; } public onSave(e): void { + debugger; this.academic.educationTypeID = this.selectedEducationTypeID; this.academic.educationLevelID = this.selectedEducationLevelID; this.academic.institutionID = this.selectedInstitutionID; 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) { this.notificationService.showWarning('please select an employee'); this.onCancel(null); @@ -320,10 +331,9 @@ export class AcademicEntryComponent implements OnInit { return; } - this.academic.createdBy = 0; this.academic.employeeID = this.employeeService.hrEmployee.id; - this.academic.createdDate = new Date(this.academic.createdBy); this.academic.createdBy = 0; + this.academic.createdDate = new Date(); this.loadingPanelService.ShowLoadingPanel = true; this.employeeService.saveEmployeeAcademic(this.academic).subscribe( (resp) => { diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/contact/contact.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/contact/contact.component.ts index aee7448..dd74c95 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/contact/contact.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/contact/contact.component.ts @@ -104,10 +104,10 @@ export class ContactComponent implements OnInit { contactOfficialEmail: new FormControl(''), contactFax: new FormControl(''), - emergencyContactPerson: new FormControl('', Validators.required), - emergencyAddress: new FormControl('', Validators.required), + emergencyContactPerson: new FormControl(''), + emergencyAddress: new FormControl(''), emergencyLandPhone: new FormControl(''), - emergencyMobileNo: new FormControl('', Validators.required), + emergencyMobileNo: new FormControl(''), relation: new FormControl(''), presentPOInBangla: new FormControl(''), diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html index 94af919..a8aa423 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html @@ -27,7 +27,7 @@ - + diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts index 0da1a2e..c9e8038 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts @@ -1,16 +1,17 @@ -import {Component, OnInit} from '@angular/core'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; -import {EmployeeServices} from '../../_services/employee/employee.service'; -import {empFileuploads, HrEmployee} from '../../_models/HREmployee/hrEmployee'; -import {SearchEmployee} from '../../_models/Employee/searchEmployee'; -import {DataTransferService} from '../../data.transfer.service'; -import {BasicService} from '../../_services/Basic/basic.service'; -import {enumEmpFileUploadType, EnumExtension, EnumGender, EnumStatus} from '../../_models/enums'; -import {EmpContact} from '../../_models/HREmployee/empContact'; -import {ApiService} from '../../app.api.service'; -import {loadingPanelService} from '../../hrm-loding panel/loding.panel.service'; -import {HRMNotificationService} from '../../app.notification.service'; -import {DomSanitizer} from '@angular/platform-browser'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { EmployeeServices } from '../../_services/employee/employee.service'; +import { empFileuploads, HrEmployee } from '../../_models/HREmployee/hrEmployee'; +import { SearchEmployee } from '../../_models/Employee/searchEmployee'; +import { DataTransferService } from '../../data.transfer.service'; +import { BasicService } from '../../_services/Basic/basic.service'; +import { enumEmpFileUploadType, EnumExtension, EnumGender, EnumStatus } from '../../_models/enums'; +import { EmpContact } from '../../_models/HREmployee/empContact'; +import { ApiService } from '../../app.api.service'; +import { loadingPanelService } from '../../hrm-loding panel/loding.panel.service'; +import { HRMNotificationService } from '../../app.notification.service'; +import { DomSanitizer } from '@angular/platform-browser'; +import { Nationality } from '../nationality/nationality'; @Component({ selector: 'app-employee-profile', @@ -30,12 +31,13 @@ export class EmployeeProfileComponent implements OnInit { attachment: any; fileType = ''; isDisplay = false; + defaultNationality: Nationality; constructor(private fb: FormBuilder, - public employeeService: EmployeeServices, - public basicService: BasicService, - public dataTransferService: DataTransferService, public apiService: ApiService, - public loadingPanel: loadingPanelService, public notificationService: HRMNotificationService, - private sanitizer: DomSanitizer) { + public employeeService: EmployeeServices, + public basicService: BasicService, + public dataTransferService: DataTransferService, public apiService: ApiService, + public loadingPanel: loadingPanelService, public notificationService: HRMNotificationService, + private sanitizer: DomSanitizer) { this.employeeService.hrEmployee = new HrEmployee(); this.hrEmployeeProfile = new HrEmployee(); this.contact = new EmpContact(); @@ -261,6 +263,11 @@ export class EmployeeProfileComponent implements OnInit { this.employeeService.hrEmployee.passportExpDate = new Date(this.employeeService.hrEmployee.passportExpDate); 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.employeeService.Employee_Get_Completed.next(this.hrEmployeeProfile); } @@ -292,12 +299,12 @@ export class EmployeeProfileComponent implements OnInit { this.contact = item; } - editHandler({dataItem}) { + editHandler({ dataItem }) { this.isDisplay = true; const item = dataItem as empFileuploads; this.attachment = item.fileData; const type = item.fileName.split('.').pop(); - if ( type === 'png' || type === 'jpg' || type === 'jpeg') { + if (type === 'png' || type === 'jpg' || type === 'jpeg') { this.fileType = 'image'; } else if (type === 'pdf') { @@ -308,5 +315,9 @@ export class EmployeeProfileComponent implements OnInit { onPopUpClose() { this.isDisplay = false; } + + defaultNationalityHandler(dataItem: Nationality) { + this.defaultNationality = dataItem; + } } 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 cfedd67..4b25e67 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 @@ -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 { DataTransferService } from '../../../data.transfer.service'; import { EmployeeServices } from '../../../_services/employee/employee.service'; @@ -126,6 +126,7 @@ export class GeneralComponent implements OnInit { permanentThanas: Thana[]; isAccessCard: boolean = false; + @Output() defaultNationalityHandler = new EventEmitter(); constructor(public employeeService: EmployeeServices, public basicService: BasicService, public notificationService: HRMNotificationService, @@ -179,6 +180,7 @@ export class GeneralComponent implements OnInit { this.defaultNationality = this.nationalities.find(x => x.description.toLowerCase() == "bangladeshi"); if (this.defaultNationality) { this.hrEmployee.nationalityID = this.defaultNationality.id; + this.defaultNationalityHandler.emit(this.defaultNationality); } } ); -- 2.40.0.windows.1 From 6e8a28a4778cf4c2e574a834660caaa7452d12d0 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Wed, 5 Feb 2025 15:02:49 +0600 Subject: [PATCH 2/9] roster assignment type addition --- HRM.UI/ClientApp/src/app/app.api.service.ts | 2 +- .../echotex-roster-assignment.component.html | 14 +++++- .../echotex-roster-assignment.component.ts | 43 +++++++++++++++---- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/app.api.service.ts b/HRM.UI/ClientApp/src/app/app.api.service.ts index 34679f7..8c79343 100644 --- a/HRM.UI/ClientApp/src/app/app.api.service.ts +++ b/HRM.UI/ClientApp/src/app/app.api.service.ts @@ -13,7 +13,7 @@ export class ApiService { public isSSO = 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 base_url = ''; // public currentLink = ''; diff --git a/HRM.UI/ClientApp/src/app/attendance/echotex-roster-assignment/echotex-roster-assignment.component.html b/HRM.UI/ClientApp/src/app/attendance/echotex-roster-assignment/echotex-roster-assignment.component.html index ec22198..460a2de 100644 --- a/HRM.UI/ClientApp/src/app/attendance/echotex-roster-assignment/echotex-roster-assignment.component.html +++ b/HRM.UI/ClientApp/src/app/attendance/echotex-roster-assignment/echotex-roster-assignment.component.html @@ -11,13 +11,25 @@ +
+ + + +
+
+ + +
- diff --git a/HRM.UI/ClientApp/src/app/attendance/echotex-roster-assignment/echotex-roster-assignment.component.ts b/HRM.UI/ClientApp/src/app/attendance/echotex-roster-assignment/echotex-roster-assignment.component.ts index 63d58b4..094b4d8 100644 --- a/HRM.UI/ClientApp/src/app/attendance/echotex-roster-assignment/echotex-roster-assignment.component.ts +++ b/HRM.UI/ClientApp/src/app/attendance/echotex-roster-assignment/echotex-roster-assignment.component.ts @@ -31,16 +31,23 @@ export class EchotexRosterAssignmentComponent implements OnInit { workPlanGroupName = ''; workPlanGroupInitialShift = ''; workPlanGroupList: WorkPlanGroup[]; + workPlanGroupListByType: WorkPlanGroup[] = []; selectedEmployees: SearchEmployee[]; employees: Employee[]; empIds: number[] = []; exportExcelFileName: string = ''; + selectedWorkPlanTypeIsFixed: boolean; selectedWorkPlanID: number; fixedWorkPlan: boolean = true; startDate: Date; holidayDayOfWeekArray = Object.values(HolidayDayOfWeek); + workPlanTypes: { text: string, value: boolean| null }[] = [ + { text: 'Fixed', value: true }, + { text: 'Counter Clock', value: false } + ] + constructor(public employeeService: EmployeeServices, public attendanceServices: AttendanceServices, public apiService: ApiService, @@ -85,6 +92,7 @@ export class EchotexRosterAssignmentComponent implements OnInit { createForm() { this.rosterAssignmentForm = new FormBuilder().group({ + type: ['', Validators.required], group: ['', Validators.required], startDate: [''], }); @@ -202,13 +210,13 @@ export class EchotexRosterAssignmentComponent implements OnInit { this.loadingPanel.ShowLoadingPanel = true; this.empWorkPlanSetupList = []; debugger; - if (workPlanGroup.type != EnumWorkPlanGroup.Fixed && - (workPlanGroup.type != undefined || workPlanGroup.type != null)) { - this.fixedWorkPlan = false; - this.startDate = new Date(); - } else { - this.fixedWorkPlan = true; - } + // if (workPlanGroup.type != EnumWorkPlanGroup.Fixed && + // (workPlanGroup.type != undefined || workPlanGroup.type != null)) { + // this.fixedWorkPlan = false; + // this.startDate = new Date(); + // } else { + // this.fixedWorkPlan = true; + // } this.attendanceServices.getEmployeeWorkPlanSetupByWPGroupID(workPlanGroup.id).subscribe( (resp) => { this.empWorkPlanSetupList = resp; @@ -331,7 +339,7 @@ export class EchotexRosterAssignmentComponent implements OnInit { ); } - public getHolidayDayOfWeek( day: number): string { + public getHolidayDayOfWeek(day: number): string { debugger; day = day + 1; switch (day) { @@ -365,4 +373,23 @@ export class EchotexRosterAssignmentComponent implements OnInit { // 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(); + } + } + } -- 2.40.0.windows.1 From 083ae15e1e7e8df2179c5f43b190169ebffffa3c Mon Sep 17 00:00:00 2001 From: mashfiq Date: Wed, 12 Feb 2025 11:12:32 +0600 Subject: [PATCH 3/9] employee profile issues --- .../employee-profile.component.html | 4 +++- .../employee-profile/employee-profile.component.ts | 6 ++++++ .../children-list/children-list.component.ts | 1 + .../spouse/spouse-list/spouse-list.component.ts | 1 + .../employee-profile/general/general.component.ts | 13 ++++++++++--- .../nominee/nominee-list/nominee-list.component.ts | 1 + 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html index a8aa423..ed3b9cd 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html @@ -27,7 +27,9 @@ - + diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts index c9e8038..f93da83 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts @@ -12,6 +12,7 @@ import { loadingPanelService } from '../../hrm-loding panel/loding.panel.service import { HRMNotificationService } from '../../app.notification.service'; import { DomSanitizer } from '@angular/platform-browser'; import { Nationality } from '../nationality/nationality'; +import { Category } from 'src/app/_models/Basic/category'; @Component({ selector: 'app-employee-profile', @@ -32,6 +33,7 @@ export class EmployeeProfileComponent implements OnInit { fileType = ''; isDisplay = false; defaultNationality: Nationality; + defaultEmployeeType: Category; constructor(private fb: FormBuilder, public employeeService: EmployeeServices, public basicService: BasicService, @@ -267,6 +269,7 @@ export class EmployeeProfileComponent implements OnInit { 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); } @@ -319,5 +322,8 @@ export class EmployeeProfileComponent implements OnInit { defaultNationalityHandler(dataItem: Nationality) { this.defaultNationality = dataItem; } + defaultEmployeeTypeHandler(dataItem: Category) { + this.defaultEmployeeType = dataItem; + } } diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts index 5dbe1a0..c338f7d 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts @@ -67,6 +67,7 @@ export class ChildrenListComponent implements OnInit { addNew() { this.editIndex = -1; this.empChildren = new EmpChildren(); + this.empChildren.birthDate = new Date(); this.isDisplay = true; } diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts index 0e43d2f..27400e7 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts @@ -68,6 +68,7 @@ export class SpouseListComponent implements OnInit { addNew() { this.editIndex = -1; this.empSpouse = new EmpSpouse(); + this.empSpouse.marriageDate = new Date(); this.isDisplay = true; } 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 4b25e67..0c16708 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 @@ -115,6 +115,7 @@ export class GeneralComponent implements OnInit { pickerEmployee: SearchEmployee; nationalities: Nationality[]; defaultNationality: Nationality; + defaultEmployeeType: Category; nameBangla: string = 'asasas'; defaultPhoto = "assets/photos/profile-default.jpg"; photoPath = "Documents/EMPPHOTO"; @@ -127,6 +128,7 @@ export class GeneralComponent implements OnInit { isAccessCard: boolean = false; @Output() defaultNationalityHandler = new EventEmitter(); + @Output() defaultEmployeeTypeHandler = new EventEmitter(); constructor(public employeeService: EmployeeServices, public basicService: BasicService, public notificationService: HRMNotificationService, @@ -157,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); + } } ); @@ -179,8 +186,8 @@ export class GeneralComponent implements OnInit { () => { this.defaultNationality = this.nationalities.find(x => x.description.toLowerCase() == "bangladeshi"); if (this.defaultNationality) { - this.hrEmployee.nationalityID = this.defaultNationality.id; - this.defaultNationalityHandler.emit(this.defaultNationality); + // this.hrEmployee.nationalityID = this.defaultNationality.id; + this.defaultNationalityHandler.emit(this.defaultNationality); } } ); @@ -462,7 +469,7 @@ export class GeneralComponent implements OnInit { // } this.employeeService.saveHrPersonalInfo(this.hrEmployee).subscribe( (resp: HrEmployee) => { - if(resp != undefined){ + if (resp != undefined) { this.hrEmployee.id = resp.id; if (this.active == false) { this.hrEmployee.employeeNo = resp.employeeNo; diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts index df3fc12..b7039fe 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts @@ -86,6 +86,7 @@ export class NomineeListComponent implements OnInit { this.editIndex = -1; this.nominee = new EmpNominee(); this.nominee.employeeID = this.employeeService.hrEmployee.id; + this.nominee.percentage = 100; this.isDisplay = true; } public editHandler(rowIndex: any) { -- 2.40.0.windows.1 From 057e27c226c231df92785bdc919b12a33439a896 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Wed, 12 Feb 2025 18:02:49 +0600 Subject: [PATCH 4/9] multiple letter generation --- .../letter-request/letter-request.service.ts | 5 + .../adhoc-feature-routing.module.ts | 2 + .../app/adhoc-feature/adhoc-feature.module.ts | 3 +- .../exception-letter-generate.component.html | 58 +++++++ .../exception-letter-generate.component.scss | 0 .../exception-letter-generate.component.ts | 162 ++++++++++++++++++ .../letter-generate.component.html | 1 + .../letter-generate.component.ts | 1 + .../LetterRequest/LetterRequestController.cs | 84 +++++++++ 9 files changed, 315 insertions(+), 1 deletion(-) create mode 100644 HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.html create mode 100644 HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.scss create mode 100644 HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.ts diff --git a/HRM.UI/ClientApp/src/app/_services/letter-request/letter-request.service.ts b/HRM.UI/ClientApp/src/app/_services/letter-request/letter-request.service.ts index df63f04..bc4fabe 100644 --- a/HRM.UI/ClientApp/src/app/_services/letter-request/letter-request.service.ts +++ b/HRM.UI/ClientApp/src/app/_services/letter-request/letter-request.service.ts @@ -11,6 +11,7 @@ import { EnumLetterOrganizationType } from '../../_models/enums'; import { LetterRequest } from '../../_models/Letter-Request/Letter-Request'; import { AuthorizedPerson } from '../../adhoc-feature/authorized-persons/authorizedPerson'; import { WFMovementTran } from '../../_models/Work-Flow/wFMovementTran'; +import { SearchEmployee } from 'src/app/_models/Employee/searchEmployee'; @Injectable({ providedIn: 'root' @@ -233,6 +234,10 @@ export class LetterRequestService { getImage(id: number) { return this.apiService.httpGet('/LetterRequest/getImage' + '/' + id); } + generatedExceptiinLetter(type: number, param: SearchEmployee[]) { + return this.apiService.httpPost('/LetterRequest/generatedExceptiinLetter/' + type , param); + // return this.apiService.httpDownloadFile('/LetterRequest/generatedExceptiinLetter/' + type , param); + } } diff --git a/HRM.UI/ClientApp/src/app/adhoc-feature/adhoc-feature-routing.module.ts b/HRM.UI/ClientApp/src/app/adhoc-feature/adhoc-feature-routing.module.ts index 6fa10ca..be0ae26 100644 --- a/HRM.UI/ClientApp/src/app/adhoc-feature/adhoc-feature-routing.module.ts +++ b/HRM.UI/ClientApp/src/app/adhoc-feature/adhoc-feature-routing.module.ts @@ -19,6 +19,7 @@ import {LetterRequestByAdminApprovalComponent} from './letter-request-by-admin-a import {ApproveFinancialDataComponent} from './approve-financial-data/approve-financial-data.component'; import {AuthorizedPersonsComponent} from './authorized-persons/authorized-persons.component'; import { LetterGenerateComponent } from './letter-generate/letter-generate.component'; +import { ExceptionLetterGenerateComponent } from './exception-letter-generate/exception-letter-generate.component'; const routes: Routes = [ @@ -31,6 +32,7 @@ const routes: Routes = [ {path: 'letter-generate', component: LetterGenerateComponent, canActivate: [AuthGuard]}, {path: 'workflow-delegation-by-employee', component: WorkflowDelegationByEmployeeComponent, 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-approval', component: LetterRequestApprovalComponent, canActivate: [AuthGuard]}, //{path: 'letter-print-by-admin-panel', component: LetterPrintByAdminPanelComponent, canActivate: [AuthGuard]}, diff --git a/HRM.UI/ClientApp/src/app/adhoc-feature/adhoc-feature.module.ts b/HRM.UI/ClientApp/src/app/adhoc-feature/adhoc-feature.module.ts index e5e9843..88055b1 100644 --- a/HRM.UI/ClientApp/src/app/adhoc-feature/adhoc-feature.module.ts +++ b/HRM.UI/ClientApp/src/app/adhoc-feature/adhoc-feature.module.ts @@ -49,13 +49,14 @@ import { ApproveFinancialDataComponent } from './approve-financial-data/approve- import { AuthorizedPersonsComponent } from './authorized-persons/authorized-persons.component'; import { AuthorizedPersonComponent } from './authorized-persons/authorized-person/authorized-person.component'; import { LetterGenerateComponent } from './letter-generate/letter-generate.component'; +import { ExceptionLetterGenerateComponent } from './exception-letter-generate/exception-letter-generate.component'; @NgModule({ declarations: [workflowRuleComponent, WorkFlowSetupComponent, WorkFlowSetupNewComponent, WorkFlowAdministrativeStatusComponent, WorkFlowAdminComponent, WorkflowDelegationByEmployeeComponent, DelegationFromAdminPanelComponent, LetterRequestApprovalComponent, LetterPrintByAdminPanelComponent, - LetterRequestByAdminApprovalComponent, ApproveFinancialDataComponent, AuthorizedPersonsComponent, AuthorizedPersonComponent, LetterGenerateComponent + LetterRequestByAdminApprovalComponent, ApproveFinancialDataComponent, AuthorizedPersonsComponent, AuthorizedPersonComponent, LetterGenerateComponent, ExceptionLetterGenerateComponent ], imports: [ diff --git a/HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.html b/HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.html new file mode 100644 index 0000000..abff192 --- /dev/null +++ b/HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.html @@ -0,0 +1,58 @@ + +
+
+
+
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ + + + + + + + + + + + + + +
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.scss b/HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.ts b/HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.ts new file mode 100644 index 0000000..4812a15 --- /dev/null +++ b/HRM.UI/ClientApp/src/app/adhoc-feature/exception-letter-generate/exception-letter-generate.component.ts @@ -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 +} diff --git a/HRM.UI/ClientApp/src/app/adhoc-feature/letter-generate/letter-generate.component.html b/HRM.UI/ClientApp/src/app/adhoc-feature/letter-generate/letter-generate.component.html index 1d48442..bf85a57 100644 --- a/HRM.UI/ClientApp/src/app/adhoc-feature/letter-generate/letter-generate.component.html +++ b/HRM.UI/ClientApp/src/app/adhoc-feature/letter-generate/letter-generate.component.html @@ -55,6 +55,7 @@
+
diff --git a/HRM.UI/ClientApp/src/app/adhoc-feature/letter-generate/letter-generate.component.ts b/HRM.UI/ClientApp/src/app/adhoc-feature/letter-generate/letter-generate.component.ts index bbed72a..cabdf45 100644 --- a/HRM.UI/ClientApp/src/app/adhoc-feature/letter-generate/letter-generate.component.ts +++ b/HRM.UI/ClientApp/src/app/adhoc-feature/letter-generate/letter-generate.component.ts @@ -60,6 +60,7 @@ export class LetterGenerateComponent implements OnInit { }; } this.showPopUp = true; + this.loadingPanelService.ShowLoadingPanel = true; this.reportService.getAppointmentLetter(data).subscribe( (resp: any) => { if (this.reportType === 'PDF'){ diff --git a/HRM.UI/Controllers/LetterRequest/LetterRequestController.cs b/HRM.UI/Controllers/LetterRequest/LetterRequestController.cs index e529a78..d39409e 100644 --- a/HRM.UI/Controllers/LetterRequest/LetterRequestController.cs +++ b/HRM.UI/Controllers/LetterRequest/LetterRequestController.cs @@ -11,11 +11,13 @@ using AutoMapper.Configuration; using Google.Protobuf.WellKnownTypes; using HRM.BO; using HRM.DA; +using HRM.Report; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.StaticFiles; using Microsoft.Extensions.Configuration; +using NPOI.HPSF; using NPOI.SS.Formula.Functions; using Org.BouncyCastle.Ocsp; using static HRM.Report.PayrollDataSet.PayrollDataSet; @@ -783,6 +785,88 @@ namespace HRM.UI.Controllers } + [HttpPost("generatedExceptiinLetter/{letterType}")] + public ActionResult generatedExceptiinLetter(int letterType, List 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 sFilePaths = new List(); + List> filesWithContents = new List>(); + List files = new List(); + + 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(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(); + } } } \ No newline at end of file -- 2.40.0.windows.1 From e9b633703096fd4212dc0cc6b2a1ba80ed78c30c Mon Sep 17 00:00:00 2001 From: mashfiq Date: Sun, 23 Feb 2025 09:01:17 +0600 Subject: [PATCH 5/9] EnumBloodgroup changed --- HRM.BO/HRBasic/Enums.cs | 29 +++++++++++++++-------- HRM.UI/ClientApp/src/app/_models/enums.ts | 13 ++++++++-- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/HRM.BO/HRBasic/Enums.cs b/HRM.BO/HRBasic/Enums.cs index 703f1c1..0017680 100644 --- a/HRM.BO/HRBasic/Enums.cs +++ b/HRM.BO/HRBasic/Enums.cs @@ -1477,16 +1477,25 @@ namespace HRM.BO public enum EnumBloodGroup { - None = 0, - APos = 1, - ANeg = 2, - BPos = 3, - BNeg = 4, - OPos = 5, - ONeg = 6, - ABPos = 7, - ABNeg = 8, - NA = 9 + //None = 0, + //APos = 1, + //ANeg = 2, + //BPos = 3, + //BNeg = 4, + //OPos = 5, + //ONeg = 6, + //ABPos = 7, + //ABNeg = 8, + NA = 0, + None = 1, + APos = 2, + ANeg = 3, + BPos = 4, + BNeg = 5, + OPos = 6, + ONeg = 7, + ABPos = 8, + ABNeg = 9 } diff --git a/HRM.UI/ClientApp/src/app/_models/enums.ts b/HRM.UI/ClientApp/src/app/_models/enums.ts index 716fb0b..4b30306 100644 --- a/HRM.UI/ClientApp/src/app/_models/enums.ts +++ b/HRM.UI/ClientApp/src/app/_models/enums.ts @@ -998,6 +998,16 @@ export enum EnumTrainingCompletedFrom { } export enum EnumBloodGroup { + // None, + // APos, + // ANeg, + // BPos, + // BNeg, + // OPos, + // ONeg, + // ABPos, + // ABNeg, + NA, None, APos, ANeg, @@ -1005,8 +1015,7 @@ export enum EnumBloodGroup { BNeg, OPos, ONeg, - ABPos, - ABNeg, + ABPos } export enum EnumOGPositionType { -- 2.40.0.windows.1 From 751ae428bbd7db5fe4d5fa7186cbdb85658afb68 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Sun, 23 Feb 2025 09:07:30 +0600 Subject: [PATCH 6/9] blood group --- HRM.BO/HRBasic/Enums.cs | 9 --------- HRM.UI/ClientApp/src/app/_models/enums.ts | 12 ++---------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/HRM.BO/HRBasic/Enums.cs b/HRM.BO/HRBasic/Enums.cs index 0017680..90f48c2 100644 --- a/HRM.BO/HRBasic/Enums.cs +++ b/HRM.BO/HRBasic/Enums.cs @@ -1477,15 +1477,6 @@ namespace HRM.BO public enum EnumBloodGroup { - //None = 0, - //APos = 1, - //ANeg = 2, - //BPos = 3, - //BNeg = 4, - //OPos = 5, - //ONeg = 6, - //ABPos = 7, - //ABNeg = 8, NA = 0, None = 1, APos = 2, diff --git a/HRM.UI/ClientApp/src/app/_models/enums.ts b/HRM.UI/ClientApp/src/app/_models/enums.ts index 4b30306..f5b3fe2 100644 --- a/HRM.UI/ClientApp/src/app/_models/enums.ts +++ b/HRM.UI/ClientApp/src/app/_models/enums.ts @@ -998,15 +998,6 @@ export enum EnumTrainingCompletedFrom { } export enum EnumBloodGroup { - // None, - // APos, - // ANeg, - // BPos, - // BNeg, - // OPos, - // ONeg, - // ABPos, - // ABNeg, NA, None, APos, @@ -1015,7 +1006,8 @@ export enum EnumBloodGroup { BNeg, OPos, ONeg, - ABPos + ABPos, + ABNeg } export enum EnumOGPositionType { -- 2.40.0.windows.1 From efbd3ca782b9e8decf7a4db1e587342620e8ac33 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Sun, 23 Feb 2025 16:13:19 +0600 Subject: [PATCH 7/9] Profile related works --- HRM.BO/HREmployee/HREmployee.cs | 2 + HRM.DA/DA/HREmployee/HREmployeeDA.cs | 10 ++-- HRM.DA/DA/SearchReport/SearchEmployeeDA.cs | 11 +++- .../Service/HREmployee/HREmployeeService.cs | 2 + .../src/app/_models/HREmployee/empContact.ts | 2 + HRM.UI/ClientApp/src/app/_models/enums.ts | 17 +++--- HRM.UI/ClientApp/src/app/app.api.service.ts | 2 +- .../contact/contact.component.html | 58 +++++++++++++------ .../contact/contact.component.ts | 7 ++- .../employee-payroll-profile.component.html | 2 +- .../employee-payroll-profile.component.ts | 3 + .../life-cycle-entry.component.ts | 27 ++++++++- 12 files changed, 103 insertions(+), 40 deletions(-) diff --git a/HRM.BO/HREmployee/HREmployee.cs b/HRM.BO/HREmployee/HREmployee.cs index 5fc00d4..fec50cc 100644 --- a/HRM.BO/HREmployee/HREmployee.cs +++ b/HRM.BO/HREmployee/HREmployee.cs @@ -259,7 +259,9 @@ namespace HRM.BO public Relation ContactPersonRelation { get; set; } public string PermanentAddressInBangla { get; set; } public string PresentAddressInBangla { get; set; } + public string PresentPO { get; set; } public string PresentPOInBangla { get; set; } + public string PermanentPO { get; set; } public string ParmanentPOInBangla { get; set; } //#region Property PermanentDistrict : District diff --git a/HRM.DA/DA/HREmployee/HREmployeeDA.cs b/HRM.DA/DA/HREmployee/HREmployeeDA.cs index b05dcd4..102745b 100644 --- a/HRM.DA/DA/HREmployee/HREmployeeDA.cs +++ b/HRM.DA/DA/HREmployee/HREmployeeDA.cs @@ -434,12 +434,12 @@ namespace HRM.DA "EmployeeID, ContactID, PARMANENTADDRESS, PARMANENTDISTRICTID, PARMANENTTHANAID, PARMANENTTELEPHONE," + " PresentAddress, PresentDistrictID, PresentThanaID, PresentTelephone, Mobile, PersonalEmail," + " OfficialEMail, Fax, EmergencyContactAddress, EmergencyContactPerson, EmergencyTelephone, PARMANENTMOBILE, " + - " PRESENTMOBILE, PERSONALTELEPHONE, EMERGENCYMOBILE, CPRELATIONID,ProfileStatus,PermanentAddressInBangla,PresentAddressInBangla,PermanentPostCodeNo,PresentPostCodeNo, PresentPOInBangla, ParmanentPOInBangla)" + + " PRESENTMOBILE, PERSONALTELEPHONE, EMERGENCYMOBILE, CPRELATIONID,ProfileStatus,PermanentAddressInBangla,PresentAddressInBangla,PermanentPostCodeNo,PresentPostCodeNo, PresentPOInBangla, ParmanentPOInBangla, PresentPO, PermanentPO)" + " VALUES(" + " %n, %n, %s, %n, %n, %s, " + " %s, %n, %n, %s, %s, %s," + " %s, %s, %s, %s, %s, %s," + - " %s, %s, %s, %n,%n, %u, %u, %s, %s, %u, %u)", + " %s, %s, %s, %n,%n, %u, %u, %s, %s, %u, %u, %s, %s)", item.EmployeeID, item.ID, item.PermanentAddress, DataReader.GetNullValue(item.PermanentDistrictID, 0), DataReader.GetNullValue(item.PermanentThanaID, 0), item.PermanentTelephone, item.PresentAddress, DataReader.GetNullValue(item.PresentDistrictID, 0), @@ -448,7 +448,7 @@ namespace HRM.DA item.EmergencyTelephone, DataReader.GetNullValue(item.PermanentMobile), DataReader.GetNullValue(item.PresentMobile), DataReader.GetNullValue(item.PersonalTelephone), DataReader.GetNullValue(item.EmergencyMobile), - DataReader.GetNullValue(item.ContactPersonRelationId, 0), item.ProfileStatus, item.PermanentAddressInBangla, item.PresentAddressInBangla, item.PermanentPostCodeNo, item.PresentPostCodeNo, item.PresentPOInBangla, item.ParmanentPOInBangla); + DataReader.GetNullValue(item.ContactPersonRelationId, 0), item.ProfileStatus, item.PermanentAddressInBangla, item.PresentAddressInBangla, item.PermanentPostCodeNo, item.PresentPostCodeNo, item.PresentPOInBangla, item.ParmanentPOInBangla, item.PresentPO, item.PermanentPO); tc.ExecuteNonQuery(sql); } @@ -459,7 +459,7 @@ namespace HRM.DA "PARMANENTADDRESS =%s , PARMANENTDISTRICTID =%n, PARMANENTTHANAID =%n, PARMANENTTELEPHONE=%s," + " PresentAddress=%s, PresentDistrictID=%n, PresentThanaID=%n, PresentTelephone=%s, Mobile =%s, PersonalEmail=%s," + " OfficialEMail=%s, Fax=%s, EmergencyContactAddress=%s, EmergencyContactPerson=%s, EmergencyTelephone=%s, PARMANENTMOBILE=%s, " + - " PRESENTMOBILE=%s, PERSONALTELEPHONE=%s, EMERGENCYMOBILE=%s, CPRELATIONID=%n,ProfileStatus=%n,PermanentAddressInBangla=%u,PresentAddressInBangla=%u,PermanentPostCodeNo=%s,PresentPostCodeNo=%s, PresentPOInBangla = %u, ParmanentPOInBangla = %u" + + " PRESENTMOBILE=%s, PERSONALTELEPHONE=%s, EMERGENCYMOBILE=%s, CPRELATIONID=%n,ProfileStatus=%n,PermanentAddressInBangla=%u,PresentAddressInBangla=%u,PermanentPostCodeNo=%s,PresentPostCodeNo=%s, PresentPOInBangla = %u, ParmanentPOInBangla = %u, PresentPO = %s, PermanentPO = %s" + " where EmployeeID =%n and ContactID =%n ", item.PermanentAddress, DataReader.GetNullValue(item.PermanentDistrictID, 0), DataReader.GetNullValue(item.PermanentThanaID, 0), item.PermanentTelephone, @@ -469,7 +469,7 @@ namespace HRM.DA item.EmergencyTelephone, DataReader.GetNullValue(item.PermanentMobile), DataReader.GetNullValue(item.PresentMobile), DataReader.GetNullValue(item.PersonalTelephone), DataReader.GetNullValue(item.EmergencyMobile), - DataReader.GetNullValue(item.ContactPersonRelationId, 0), item.ProfileStatus, item.PermanentAddressInBangla, item.PresentAddressInBangla, item.PermanentPostCodeNo, item.PresentPostCodeNo, item.PresentPOInBangla, item.ParmanentPOInBangla, item.EmployeeID, item.ID); + DataReader.GetNullValue(item.ContactPersonRelationId, 0), item.ProfileStatus, item.PermanentAddressInBangla, item.PresentAddressInBangla, item.PermanentPostCodeNo, item.PresentPostCodeNo, item.PresentPOInBangla, item.ParmanentPOInBangla, item.PresentPO, item.PermanentPO, item.EmployeeID, item.ID); tc.ExecuteNonQuery(sql); } diff --git a/HRM.DA/DA/SearchReport/SearchEmployeeDA.cs b/HRM.DA/DA/SearchReport/SearchEmployeeDA.cs index 899fe5d..19fbd65 100644 --- a/HRM.DA/DA/SearchReport/SearchEmployeeDA.cs +++ b/HRM.DA/DA/SearchReport/SearchEmployeeDA.cs @@ -385,9 +385,16 @@ END;"; if (name != string.Empty) sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("Name LIKE %s", ("%" + name + "%")); + //string finalSQl = SQLParser.MakeSQL( + // "%q Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q %q Order by %s", + // recurSqlClause, top, sqlClause, recurWhereClause, orderby); + + string finalSQl = SQLParser.MakeSQL( - "%q Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q %q Order by %s", - recurSqlClause, top, sqlClause, recurWhereClause, orderby); + "%q Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q %q " + + " UNION Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q " + + " Order by %s", + recurSqlClause, top, sqlClause, recurWhereClause, top, sqlClause, orderby); return tc.ExecuteReader(finalSQl); } diff --git a/HRM.DA/Service/HREmployee/HREmployeeService.cs b/HRM.DA/Service/HREmployee/HREmployeeService.cs index e9f9459..9d2fca3 100644 --- a/HRM.DA/Service/HREmployee/HREmployeeService.cs +++ b/HRM.DA/Service/HREmployee/HREmployeeService.cs @@ -254,6 +254,8 @@ namespace HRM.DA oEmpContact.ProfileStatus = (EnumProfileStatus)oReader.GetInt32("ProfileStatus").GetValueOrDefault(); oEmpContact.PresentPOInBangla = oReader.GetString("PresentPOInBangla", true, null); oEmpContact.ParmanentPOInBangla = oReader.GetString("ParmanentPOInBangla", true, null); + oEmpContact.PresentPO = oReader.GetString("PresentPO", true, null); + oEmpContact.PermanentPO = oReader.GetString("PermanentPO", true, null); this.SetObjectState(oEmpContact, ObjectState.Saved); } diff --git a/HRM.UI/ClientApp/src/app/_models/HREmployee/empContact.ts b/HRM.UI/ClientApp/src/app/_models/HREmployee/empContact.ts index e7972d6..a7224f8 100644 --- a/HRM.UI/ClientApp/src/app/_models/HREmployee/empContact.ts +++ b/HRM.UI/ClientApp/src/app/_models/HREmployee/empContact.ts @@ -36,7 +36,9 @@ export class EmpContact extends BaseObject { presentAddressInBangla: string; permanentPostCodeNo: string; presentPostCodeNo: string; + presentPO: string; presentPOInBangla: string; + permanentPO: string; parmanentPOInBangla: string; constructor() { super(); diff --git a/HRM.UI/ClientApp/src/app/_models/enums.ts b/HRM.UI/ClientApp/src/app/_models/enums.ts index f5b3fe2..853e1cb 100644 --- a/HRM.UI/ClientApp/src/app/_models/enums.ts +++ b/HRM.UI/ClientApp/src/app/_models/enums.ts @@ -3150,14 +3150,15 @@ export enum EnumSuccessorReadiness { } export let BloodGroupList = [ - { name: "A+", value: 1 }, - { name: "A-", value: 2 }, - { name: "B+", value: 3 }, - { name: "B-", value: 4 }, - { name: "O+", value: 5 }, - { name: "O-", value: 6 }, - { name: "AB+", value: 7 }, - { name: "AB-", value: 8 }, + { name: "N/A", value: 1 }, + { name: "A+", value: 2 }, + { name: "A-", value: 3 }, + { name: "B+", value: 4 }, + { name: "B-", value: 5 }, + { name: "O+", value: 6 }, + { name: "O-", value: 7 }, + { name: "AB+", value: 8 }, + { name: "AB-", value: 9 }, ]; export class EnumExtension { diff --git a/HRM.UI/ClientApp/src/app/app.api.service.ts b/HRM.UI/ClientApp/src/app/app.api.service.ts index 8c79343..c8d4dc6 100644 --- a/HRM.UI/ClientApp/src/app/app.api.service.ts +++ b/HRM.UI/ClientApp/src/app/app.api.service.ts @@ -13,7 +13,7 @@ export class ApiService { public isSSO = false; public versionDeployement = false; - public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 5))}-`+"01"; + public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 23))}-`+"01"; public static BASE_URL = ''; public base_url = ''; // public currentLink = ''; diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/contact/contact.component.html b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/contact/contact.component.html index 370a8ef..9bbd7ea 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/contact/contact.component.html +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/contact/contact.component.html @@ -57,6 +57,21 @@ [(ngModel)]="contact.permanentTelephone" type="text" pInputText style="width:100%">
+
+ +
+
+ +
+ +
+ +
+
+ +
@@ -65,21 +80,15 @@ [(ngModel)]="contact.parmanentPOInBangla" type="text" pInputText style="width:100%">
+
- -
-
- -
-
-
+
@@ -36,10 +38,10 @@ + @@ -50,10 +52,10 @@ + @@ -94,19 +96,23 @@ -
+
+
-
+
+
-
+
+
-
+
+
diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.ts index 06299d9..9e16c82 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.ts @@ -17,6 +17,7 @@ import { BasicService } from '../../../../_services/Basic/basic.service'; import { enumEmpFileUploadType, EnumStatus } from '../../../../_models/enums'; import { loadingPanelService } from '../../../../hrm-loding panel/loding.panel.service'; import { empFileuploads } from '../../../../_models/HREmployee/hrEmployee'; +import { forkJoin } from 'rxjs'; @Component({ selector: 'app-academic-entry', @@ -115,94 +116,139 @@ export class AcademicEntryComponent implements OnInit { // } // } loadData() { - this.basicService.getAllEducationLevel().subscribe( - (resp) => { - this.alleducationLevels = resp; + // this.basicService.getAllEducationLevel().subscribe( + // (resp) => { + // this.alleducationLevels = resp; + // }, + // (err: any) => { + // console.log(err); + // }, + // () => { + // // if (this.academic.id > 0) { + // // this.educationLevels = this.alleducationLevels//.filter(x => x.educationTypeID == this.academic.educationTypeID); + // // } + // // else { + // this.educationLevels = this.alleducationLevels//.filter(x => x.educationTypeID == this.academic.educationTypeID); + // // } + // this.basicService.getAllDiscipline().subscribe( + // (resp) => { + // this.alleducationDiscipline = resp; + // }, + // (err: any) => { + // console.log(err); + // }, + // () => { + // // if (this.academic.id > 0) { + // // // this.educationDiscipline = this.alleducationDiscipline.filter(x => x.educationLevelID == this.academic.educationLevelID); + // // // this.educationDiscipline = this.alleducationDiscipline.filter(x => x.id == this.academic.disciplineID); + // // this.educationDiscipline = this.alleducationDiscipline; + // // } + // // else { + // // this.educationDiscipline = this.alleducationDiscipline.filter(x => x.educationLevelID == this.academic.educationLevelID); + // this.educationDiscipline = this.alleducationDiscipline; + // // } + + + // this.basicService.getAllInstitutions().subscribe( + // (resp) => { + // this.allinstitutions = resp; + // }, + // (err: any) => { + // console.log(err); + // }, + // () => { + // if (this.academic.id > 0) { + // // this.institutions = this.allinstitutions.filter(x => x.boardRequired == this.academic.educationType.boardRequired); + // if (this.academic.institution != undefined && this.academic.institution.boardRequired) + // // this.institutions = this.allinstitutions.filter(x => x.id == this.academic.institutionID || x.boardRequired == true); + // this.institutions = this.allinstitutions.filter(x => x.boardRequired == true); + // else + // // this.institutions = this.allinstitutions.filter(x => x.educationTypeID == this.academic.educationTypeID); + // this.institutions = this.allinstitutions.filter(x => x.boardRequired == false); + // } + // //console.log(this.institutions); + + // this.basicService.getAllResultTypesByStatus(EnumStatus.Regardless).subscribe( + // (resp) => { + // this.allresultTypes = resp; + // }, + // (err: any) => { + // console.log(err); + // }, + // () => { + // if (this.academic.id > 0) + // //console.log(this.allresultTypes); + // if (this.academic.id > 0) { + // let selectedEducationType: EducationType[] = this.educationTypes//.filter(x => x.id == this.academic.educationTypeID) + // // this.resultTypes = this.allresultTypes.filter(x => x.type == selectedEducationType[0].resultType); + // // if (selectedEducationType[0].resultType === 2 || selectedEducationType[0].resultType === 4) { + // // this.isGrade = true; + // // } + // // else { + // // 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); + // let descp = this.alleducationDiscipline.find(d => d.description.toLowerCase() == 'nil'); + // this.academic.disciplineID = descp != undefined ? descp.id : 0; + // let inst = this.allinstitutions.find(d => d.name.toLowerCase() == 'Institute of Chartered Secretary of Bangladesh'.toLowerCase()); + // this.academic.institutionID = inst != undefined ? inst.id : 0; + // } + // } + // ); + // } + // ); + // } + // ); + // } + // ); + const educationlevelService = this.basicService.getAllEducationLevel(); + const disciplineService = this.basicService.getAllDiscipline(); + const institutionService = this.basicService.getAllInstitutions(); + const resultTyoeService = this.basicService.getAllResultTypesByStatus(EnumStatus.Regardless); + + this.loadingPanelService.ShowLoadingPanel = true; + forkJoin(educationlevelService, disciplineService, institutionService, resultTyoeService).subscribe( + ([res1, res2, res3, res4]) => { + this.alleducationLevels = res1; + this.alleducationDiscipline = res2; + this.allinstitutions = res3; + this.allresultTypes = res4; }, - (err: any) => { - console.log(err); + (x) => { + this.loadingPanelService.ShowLoadingPanel = false; + console.log(x); + this.notificationService.showError(x.error); }, () => { - if (this.academic.id > 0) { - this.educationLevels = this.alleducationLevels.filter(x => x.educationTypeID == this.academic.educationTypeID); + this.educationLevels = this.alleducationLevels; + this.educationDiscipline = this.alleducationDiscipline; + this.institutions = this.allinstitutions; + this.resultTypes = this.allresultTypes; + + this.loadingPanelService.ShowLoadingPanel = 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; + let descp = this.alleducationDiscipline.find(d => d.description.toLowerCase() == 'nil'); + this.academic.disciplineID = descp != undefined ? descp.id : 0; + this.selectedDisciplineID = this.academic.disciplineID; + let inst = this.allinstitutions.find(d => d.name.toLowerCase() == 'Institute of Chartered Secretary of Bangladesh'.toLowerCase()); + this.academic.institutionID = inst != undefined ? inst.id : 0; + this. selectedInstitutionID = this.academic.institutionID; + this.academic.examDate = new Date().getFullYear(); + this.academic.passingYear = new Date().getFullYear(); + // this.selectEducationTypeEvent(educationType.id); } - else { - this.educationLevels = this.alleducationLevels.filter(x => x.educationTypeID == this.academic.educationTypeID); - } - this.basicService.getAllDiscipline().subscribe( - (resp) => { - this.alleducationDiscipline = resp; - }, - (err: any) => { - console.log(err); - }, - () => { - if (this.academic.id > 0) { - // this.educationDiscipline = this.alleducationDiscipline.filter(x => x.educationLevelID == this.academic.educationLevelID); - // this.educationDiscipline = this.alleducationDiscipline.filter(x => x.id == this.academic.disciplineID); - this.educationDiscipline = this.alleducationDiscipline; - } - else { - // this.educationDiscipline = this.alleducationDiscipline.filter(x => x.educationLevelID == this.academic.educationLevelID); - this.educationDiscipline = this.alleducationDiscipline; - } - - - this.basicService.getAllInstitutions().subscribe( - (resp) => { - this.allinstitutions = resp; - }, - (err: any) => { - console.log(err); - }, - () => { - if (this.academic.id > 0) { - // this.institutions = this.allinstitutions.filter(x => x.boardRequired == this.academic.educationType.boardRequired); - if (this.academic.institution.boardRequired) - // this.institutions = this.allinstitutions.filter(x => x.id == this.academic.institutionID || x.boardRequired == true); - this.institutions = this.allinstitutions.filter(x => x.boardRequired == true); - else - // this.institutions = this.allinstitutions.filter(x => x.educationTypeID == this.academic.educationTypeID); - this.institutions = this.allinstitutions.filter(x => x.boardRequired == false); - } - //console.log(this.institutions); - - this.basicService.getAllResultTypesByStatus(EnumStatus.Regardless).subscribe( - (resp) => { - this.allresultTypes = resp; - }, - (err: any) => { - console.log(err); - }, - () => { - if (this.academic.id > 0) - //console.log(this.allresultTypes); - if (this.academic.id > 0) { - let selectedEducationType: EducationType[] = this.educationTypes.filter(x => x.id == this.academic.educationTypeID) - // this.resultTypes = this.allresultTypes.filter(x => x.type == selectedEducationType[0].resultType); - // if (selectedEducationType[0].resultType === 2 || selectedEducationType[0].resultType === 4) { - // this.isGrade = true; - // } - // else { - // 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); - } - } - ); - } - ); - } - ); } ); } @@ -220,8 +266,8 @@ export class AcademicEntryComponent implements OnInit { } selectEducationTypeEvent(typeid: number) { if (typeid !== null) { - this.educationLevels = this.alleducationLevels.filter(x => x.educationTypeID == typeid); - let selectedEducationType: EducationType[] = this.educationTypes.filter(x => x.id == this.academic.educationTypeID) + this.educationLevels = this.alleducationLevels//.filter(x => x.educationTypeID == typeid); + let selectedEducationType: EducationType[] = this.educationTypes//.filter(x => x.id == this.academic.educationTypeID) // this.institutions = this.allinstitutions.filter(x => x.boardRequired == selectedEducationType[0].boardRequired); // this.institutions = this.allinstitutions.filter(x => x.educationTypeID == typeid); this.institutions = this.allinstitutions; @@ -260,7 +306,7 @@ export class AcademicEntryComponent implements OnInit { if (seletedInstitution.boardRequired == true) resultType = 1; else resultType = 2; if (institutionid !== null) - this.resultTypes = this.allresultTypes.filter(x => x.type == resultType); + this.resultTypes = this.allresultTypes//.filter(x => x.type == resultType); this.selectedResultTypeID = null; this.isGrade = false; diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts index c338f7d..f3f6456 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts @@ -68,6 +68,11 @@ export class ChildrenListComponent implements OnInit { this.editIndex = -1; this.empChildren = new EmpChildren(); this.empChildren.birthDate = new Date(); + let notApli = null; + if(this.occupations != null) + notApli = this.occupations.find(o => o.description.toUpperCase() == 'N/A'); + if (notApli != null) + this.empChildren.occupationID = notApli.id; this.isDisplay = true; } diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts index 27400e7..a41805f 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts @@ -1,14 +1,14 @@ -import {Component, OnInit, ViewEncapsulation} from '@angular/core'; -import {EmpSpouse} from '../../../../../_models/HREmployee/empSpouse'; -import {EmployeeServices} from '../../../../../_services/employee/employee.service'; -import {UntilityHandlerService} from '../../../../../utility.hanldler.service'; -import {DataTransferService} from '../../../../../data.transfer.service'; -import {ApiService} from '../../../../../app.api.service'; -import {AppWindowPopUp} from '../../../../../app.windowPopup.service'; -import {HRMNotificationService} from '../../../../../app.notification.service'; -import {Occupation} from '../../../../../_models/HRBasic/occupation'; -import {BasicService} from '../../../../../_services/Basic/basic.service'; -import {EducationLevel} from '../../../../../_models/HRBasic/education-level'; +import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { EmpSpouse } from '../../../../../_models/HREmployee/empSpouse'; +import { EmployeeServices } from '../../../../../_services/employee/employee.service'; +import { UntilityHandlerService } from '../../../../../utility.hanldler.service'; +import { DataTransferService } from '../../../../../data.transfer.service'; +import { ApiService } from '../../../../../app.api.service'; +import { AppWindowPopUp } from '../../../../../app.windowPopup.service'; +import { HRMNotificationService } from '../../../../../app.notification.service'; +import { Occupation } from '../../../../../_models/HRBasic/occupation'; +import { BasicService } from '../../../../../_services/Basic/basic.service'; +import { EducationLevel } from '../../../../../_models/HRBasic/education-level'; @Component({ selector: 'app-spouse-list', @@ -27,12 +27,12 @@ export class SpouseListComponent implements OnInit { editIndex: number; constructor(public employeeService: EmployeeServices, - public basicService: BasicService, - public apiService: ApiService, - public notificationService: HRMNotificationService, - public dataTransferService: DataTransferService, - public WindowPopUp: AppWindowPopUp, - public utilityHandlerService: UntilityHandlerService) { + public basicService: BasicService, + public apiService: ApiService, + public notificationService: HRMNotificationService, + public dataTransferService: DataTransferService, + public WindowPopUp: AppWindowPopUp, + public utilityHandlerService: UntilityHandlerService) { this.empSpouse = new EmpSpouse(); } @@ -68,7 +68,13 @@ export class SpouseListComponent implements OnInit { addNew() { this.editIndex = -1; this.empSpouse = new EmpSpouse(); + this.empSpouse.dateOfBirth = new Date(); this.empSpouse.marriageDate = new Date(); + let notApli = null; + if(this.occupations != null) + notApli = this.occupations.find(o => o.description.toUpperCase() == 'N/A'); + if (notApli != null) + this.empSpouse.occupationID = notApli.id; this.isDisplay = true; } @@ -86,7 +92,7 @@ export class SpouseListComponent implements OnInit { id: item.id }; this.employeeService.deleteChildData(data).subscribe( - () => {}, + () => { }, (err) => { console.log(err); }, @@ -121,7 +127,7 @@ export class SpouseListComponent implements OnInit { this.empSpouse = new EmpSpouse(); this.isDisplay = false; } - addHandler() {} + addHandler() { } onPopUpClose() { this.isDisplay = false; diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-entry/nominee-entry.component.html b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-entry/nominee-entry.component.html index 61a0e4a..fef5cf2 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-entry/nominee-entry.component.html +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-entry/nominee-entry.component.html @@ -71,11 +71,14 @@
- +
- + +
@@ -102,6 +105,83 @@ pInputText style="width:100%" />
+
+ +
+
+ +
+ + +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ +
+ +
diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-entry/nominee-entry.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-entry/nominee-entry.component.ts index c70a21c..3fe3cf7 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-entry/nominee-entry.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-entry/nominee-entry.component.ts @@ -11,10 +11,12 @@ import { HrEmployee } from '../../../../_models/HREmployee/hrEmployee'; import { BasicService } from '../../../../_services/Basic/basic.service'; import { forkJoin } from 'rxjs'; import { Relation } from '../../../../_models/HRBasic/relation'; +import { District } from '../../../../_models/HRBasic/district'; +import { Thana } from '../../../../_models/HRBasic/thana'; import { Occupation } from '../../../../_models/HRBasic/occupation'; import { NominationPurpose } from '../../../../_models/HRBasic/nomination-purpose'; import { loadingPanelService } from '../../../../hrm-loding panel/loding.panel.service'; -import { enumEmpFileUploadType } from '../../../../_models/enums'; +import { enumEmpFileUploadType, EnumExtension, EnumGender, EnumMaritalStatus } from '../../../../_models/enums'; import { debug } from 'console'; @@ -30,6 +32,9 @@ export class NomineeEntryComponent implements OnInit { nomineeForm: FormGroup; public active = false; nominee: EmpNominee; + genderType: any = EnumExtension.getNamesAndValues(EnumGender); + districts: District[]; + thanas: Thana[]; selectedPicture?: FileList; selectedSignature?: FileList; currentFile?: File; @@ -38,6 +43,8 @@ export class NomineeEntryComponent implements OnInit { @Input() public set InputObject(InputObject: EmpNominee) { this.nominee = InputObject; + if(this.nominee != undefined && this.nominee.districtID != null && this.nominee.districtID != 0) + this.loadThana(this.nominee.districtID); } constructor(public employeeService: EmployeeServices, @@ -60,12 +67,14 @@ export class NomineeEntryComponent implements OnInit { const getRelations = this.basicService.getAllRelations(); const getOccupations = this.basicService.getAllOccupation(); const getNominationPurpose = this.basicService.getAllNominationPurpose(); + const getDistricts = this.basicService.getAllDistricts(); - forkJoin([getRelations, getOccupations, getNominationPurpose]).subscribe( - ([resp1, resp2, resp3]) => { + forkJoin([getRelations, getOccupations, getNominationPurpose, getDistricts]).subscribe( + ([resp1, resp2, resp3, resp4]) => { this.relations = resp1; this.occupations = resp2; this.nominationPurposes = resp3; + this.districts = resp4; }, (x) => { console.log(x); @@ -76,6 +85,19 @@ export class NomineeEntryComponent implements OnInit { ); } + loadThana(value: any) { + this.basicService.getAllThanas(value).subscribe((resp) => { + this.thanas = resp; + }, + () => { + + }, + () => { + + } + ); + } + createForm() { this.nomineeForm = new FormBuilder().group({ nominationDate: ['', Validators.required], @@ -91,6 +113,14 @@ export class NomineeEntryComponent implements OnInit { picturePath: [''], signaturePath: [''], mobile: [''], + gender: ['', Validators.required], + fatherName: [''], + motherName: [''], + spouseName: [''], + nID: [''], + district: [''], + thana: [''], + postOffice: [''], }); } @@ -157,4 +187,5 @@ export class NomineeEntryComponent implements OnInit { selectedFiles = undefined; } } + } diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts index b7039fe..43b5f2d 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts @@ -87,6 +87,11 @@ export class NomineeListComponent implements OnInit { this.nominee = new EmpNominee(); this.nominee.employeeID = this.employeeService.hrEmployee.id; this.nominee.percentage = 100; + let notApli = null; + if(this.occupations != null) + notApli = this.occupations.find(o => o.description.toUpperCase() == 'N/A'); + if (notApli != null) + this.nominee.occupationID = notApli.id; this.isDisplay = true; } public editHandler(rowIndex: any) { -- 2.40.0.windows.1 From a3c8a22703270916e81d378d52cc8562b1e82645 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Wed, 26 Feb 2025 12:41:11 +0600 Subject: [PATCH 9/9] default set in nominee --- .../nominee/nominee-list/nominee-list.component.ts | 3 +++ .../employee-payroll-profile.component.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts index 43b5f2d..a2ef174 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts @@ -92,6 +92,9 @@ export class NomineeListComponent implements OnInit { notApli = this.occupations.find(o => o.description.toUpperCase() == 'N/A'); if (notApli != null) this.nominee.occupationID = notApli.id; + let np = this.nominationPurposes.find(n => n.id == 8); + if(this.nominationPurposes != null && np != null) + this.nominee.nominationPurposeID = np.id; this.isDisplay = true; } public editHandler(rowIndex: any) { diff --git a/HRM.UI/ClientApp/src/app/payroll/career-and-profile/employee-payroll-profile/employee-payroll-profile.component.ts b/HRM.UI/ClientApp/src/app/payroll/career-and-profile/employee-payroll-profile/employee-payroll-profile.component.ts index 6ebd5f5..65f6fbf 100644 --- a/HRM.UI/ClientApp/src/app/payroll/career-and-profile/employee-payroll-profile/employee-payroll-profile.component.ts +++ b/HRM.UI/ClientApp/src/app/payroll/career-and-profile/employee-payroll-profile/employee-payroll-profile.component.ts @@ -419,7 +419,7 @@ export class EmployeePayrollProfileComponent implements OnInit { this.selectedEmployee.categoryID = this.employee.categoryID; this.selectedEmployee.name = this.employee.name; this.selectedEmployee.employeeNo = this.employee.employeeNo; - this.showBankAccount = true; + // this.showBankAccount = true; } else { this.employee = new Employee(); -- 2.40.0.windows.1