employee profile issues upon client requirement
This commit is contained in:
parent
38e1917a33
commit
f418e7ab3d
|
@ -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; }
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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(''),
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
<p-tabView [scrollable]="true">
|
||||
<p-tabPanel header="General" leftIcon="pi pi-user">
|
||||
<app-general [isActive]="!newEmployee" [employeeNo]="this.employeeService.hrEmployee.employeeNo"></app-general>
|
||||
<app-general [isActive]="!newEmployee" [employeeNo]="this.employeeService.hrEmployee.employeeNo" (defaultNationalityHandler)="defaultNationalityHandler($event)"></app-general>
|
||||
</p-tabPanel>
|
||||
<p-tabPanel header="Contacts" leftIcon="pi pi-phone">
|
||||
<app-contact (saveContact)="saveContact($event)"></app-contact>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Nationality>();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user