From 2547d6209ef70f6aad413e2647b430b5ca5963c0 Mon Sep 17 00:00:00 2001 From: mashfiq Date: Tue, 25 Feb 2025 12:54:57 +0600 Subject: [PATCH] nominee , family , academic modified and default value addition --- HRM.BO/HREmployee/HREmployee.cs | 9 + HRM.DA/DA/HREmployee/HREmployeeDA.cs | 22 +- HRM.DA/DA/SearchReport/SearchEmployeeDA.cs | 2 +- .../Service/HREmployee/HREmployeeService.cs | 10 + .../src/app/_models/HREmployee/empNominee.ts | 10 +- HRM.UI/ClientApp/src/app/app.api.service.ts | 2 +- .../academic-entry.component.html | 26 ++- .../academic-entry.component.ts | 220 +++++++++++------- .../children-list/children-list.component.ts | 5 + .../spouse-list/spouse-list.component.ts | 44 ++-- .../nominee-entry.component.html | 86 ++++++- .../nominee-entry/nominee-entry.component.ts | 37 ++- .../nominee-list/nominee-list.component.ts | 5 + 13 files changed, 350 insertions(+), 128 deletions(-) diff --git a/HRM.BO/HREmployee/HREmployee.cs b/HRM.BO/HREmployee/HREmployee.cs index fec50cc..bfb004a 100644 --- a/HRM.BO/HREmployee/HREmployee.cs +++ b/HRM.BO/HREmployee/HREmployee.cs @@ -991,6 +991,7 @@ namespace HRM.BO _telePhone = string.Empty; _emailAddress = string.Empty; + Gender = EnumGender.None; } #endregion @@ -1140,6 +1141,14 @@ namespace HRM.BO } #endregion + public string FatherName { get; set; } + public string MotherName { get; set; } + public string SpouseName { get; set; } + public string NationalID{ get; set; } + public EnumGender Gender { get; set; } + public int? DistrictID{ get; set; } + public int? ThanaID { get; set; } + public string PostOffice { get; set; } public EnumProfileStatus ProfileStatus { get; set; } public string NomineeStatus { get; set; } public bool HasPicture { get; set; } diff --git a/HRM.DA/DA/HREmployee/HREmployeeDA.cs b/HRM.DA/DA/HREmployee/HREmployeeDA.cs index 102745b..6ef55e9 100644 --- a/HRM.DA/DA/HREmployee/HREmployeeDA.cs +++ b/HRM.DA/DA/HREmployee/HREmployeeDA.cs @@ -4,6 +4,7 @@ using Ease.Core.DataAccess; using HRM.BO; using Microsoft.AspNetCore.Routing.Template; using Microsoft.Data.SqlClient; +using Org.BouncyCastle.Asn1.X509; namespace HRM.DA { @@ -676,16 +677,16 @@ namespace HRM.DA tc.ExecuteNonQuery("INSERT INTO EmpNominee(" + "EmployeeID, NomineeID, NominationPurposeID, NominationDate, Name, RelationID, " + " Percentage, BirthDate, OccupationID, Address, TelePhone," + - " EmailAddress, NomineeMobileNo)" + + " EmailAddress, NomineeMobileNo, FatherName , MotherName , SpouseName , GENDER , DistrictID , ThanaID , PostOffice)" + " VALUES(" + " %n, %n, %n, %d, %s, %n," + - " %n, %d, %n, %s, %s, %s, %s)", + " %n, %d, %n, %s, %s, %s, %s, %s, %s, %s, %n, %n, %n, %s)", nominee.EmployeeID, nominee.ID, nominee.NominationPurposeID, DataReader.GetNullValue(nominee.NominationDate), nominee.Name, DataReader.GetNullValue(nominee.RelationID, 0), nominee.Percentage, DataReader.GetNullValue(nominee.BirthDate), DataReader.GetNullValue(nominee.OccupationID, 0), nominee.Address, nominee.TelePhone, - nominee.EmailAddress, nominee.NomineeMobileNo); + nominee.EmailAddress, nominee.NomineeMobileNo, nominee.FatherName, nominee.MotherName, nominee.SpouseName, nominee.Gender, nominee.DistrictID, nominee.ThanaID, nominee.PostOffice); } public static void Update(TransactionContext tc, EmpNominee nominee) @@ -701,8 +702,16 @@ namespace HRM.DA ,[TELEPHONE] = %s ,[EMAILADDRESS] = %s ,[NomineeMobileNo] = %s + ,[FatherName] = %s + ,[MotherName] = %s + ,[SpouseName] = %s + ,[Gender] = %n + ,[DistrictID] = %n + ,[ThanaID] = %n + ,[PostOffice] = %s WHERE NOMINEEID = %n", nominee.ID, nominee.NominationPurposeID, nominee.Name, nominee.RelationID, nominee.Percentage, nominee.OccupationID, nominee.Address, nominee.TelePhone, nominee.EmailAddress, nominee.NomineeMobileNo, + nominee.FatherName, nominee.MotherName, nominee.SpouseName, nominee.Gender, nominee.DistrictID, nominee.ThanaID, nominee.PostOffice, nominee.ID); } @@ -960,6 +969,13 @@ namespace HRM.DA ,[IsMinor] ,[NID] ,[NIDPath] + ,[FatherName] + ,[MotherName] + ,[SpouseName] + ,[Gender] + ,[DistrictID] + ,[ThanaID] + ,[PostOffice] ,iif(isnull(eu.empfileuploadid, 0) > 0, 1, 0) HasPicture ,iif(isnull(eu2.empfileuploadid, 0) > 0, 1, 0) HasSignature from [EMPNOMINEE] en diff --git a/HRM.DA/DA/SearchReport/SearchEmployeeDA.cs b/HRM.DA/DA/SearchReport/SearchEmployeeDA.cs index 19fbd65..5448128 100644 --- a/HRM.DA/DA/SearchReport/SearchEmployeeDA.cs +++ b/HRM.DA/DA/SearchReport/SearchEmployeeDA.cs @@ -376,7 +376,7 @@ END;"; //Using TOP sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo LIKE %s", ( code + "%")); orderby = "EmployeeNo"; - top = "TOP 50"; + top = "TOP 15"; //Without suggestion //sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo = %s", code ); diff --git a/HRM.DA/Service/HREmployee/HREmployeeService.cs b/HRM.DA/Service/HREmployee/HREmployeeService.cs index 9d2fca3..6801d09 100644 --- a/HRM.DA/Service/HREmployee/HREmployeeService.cs +++ b/HRM.DA/Service/HREmployee/HREmployeeService.cs @@ -558,6 +558,16 @@ namespace HRM.DA oEmpNominee.HasPicture = oReader.GetBoolean("HasPicture", true, false); oEmpNominee.HasSignature = oReader.GetBoolean("HasSignature", true, false); + oEmpNominee.FatherName = oReader.GetString("FatherName"); + oEmpNominee.MotherName = oReader.GetString("MotherName"); + oEmpNominee.SpouseName = oReader.GetString("SpouseName"); + oEmpNominee.NationalID = oReader.GetString("NID"); + oEmpNominee.Gender = (EnumGender)oReader.GetInt32("Gender", 0); + oEmpNominee.DistrictID = oReader.GetInt32("DistrictID").HasValue ? oReader.GetInt32("DistrictID").Value : null; + oEmpNominee.ThanaID = oReader.GetInt32("ThanaID").HasValue ? oReader.GetInt32("ThanaID").Value : null; + oEmpNominee.PostOffice = oReader.GetString("PostOffice"); + + this.SetObjectState(oEmpNominee, ObjectState.Saved); } diff --git a/HRM.UI/ClientApp/src/app/_models/HREmployee/empNominee.ts b/HRM.UI/ClientApp/src/app/_models/HREmployee/empNominee.ts index 129f272..c07d01c 100644 --- a/HRM.UI/ClientApp/src/app/_models/HREmployee/empNominee.ts +++ b/HRM.UI/ClientApp/src/app/_models/HREmployee/empNominee.ts @@ -1,7 +1,7 @@ import {NominationPurpose} from '../HRBasic/nomination-purpose'; import {Relation} from '../HRBasic/relation'; import {Occupation} from '../HRBasic/occupation'; -import {EnumProfileStatus} from '../enums'; +import {EnumProfileStatus, EnumGender} from '../enums'; import {BaseObject} from '../Basic/baseObject'; import {empFileuploads} from './hrEmployee'; @@ -24,6 +24,14 @@ export class EmpNominee extends BaseObject { signature: empFileuploads; emailAddress: string; profileStatus: EnumProfileStatus; + fatherName: string; + motherName: string; + spouseName: string; + nationalID: string; + gender: EnumGender; + districtID?: number | null; + thanaID?: number | null; + postOffice: string; hasPicture: boolean; hasSignature: boolean; constructor() { diff --git a/HRM.UI/ClientApp/src/app/app.api.service.ts b/HRM.UI/ClientApp/src/app/app.api.service.ts index c8d4dc6..e0d0086 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, 23))}-`+"01"; + public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 25))}-`+"01"; public static BASE_URL = ''; public base_url = ''; // public currentLink = ''; diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.html b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.html index 725fda2..678fbf5 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.html +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/academic/academic-entry/academic-entry.component.html @@ -10,9 +10,10 @@
+
@@ -23,9 +24,10 @@ + @@ -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) {