1 |
79d7de40
|
Hung Hoang
|
import {Component, Inject, Input, OnInit} from '@angular/core';
|
2 |
|
|
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material';
|
3 |
|
|
import {User} from '../user.model';
|
4 |
|
|
import {UserType} from '../../enums/common.enum';
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
@Component({
|
8 |
|
|
selector: 'app-edit-employee-dialog',
|
9 |
|
|
templateUrl: './edit-employee-dialog.component.html',
|
10 |
|
|
styleUrls: ['./edit-employee-dialog.component.sass']
|
11 |
|
|
})
|
12 |
|
|
export class EditEmployeeDialogComponent implements OnInit {
|
13 |
|
|
readonly _userTypes: string[] = ['Zaměstnanec', 'Zaměstnavatel'];
|
14 |
|
|
private _sickDaysCount: number;
|
15 |
|
|
private _vacationDaysCount: number;
|
16 |
|
|
private _userType: UserType;
|
17 |
|
|
|
18 |
|
|
constructor(public dialogRef: MatDialogRef<EditEmployeeDialogComponent>,
|
19 |
|
|
@Inject(MAT_DIALOG_DATA) public data: User) {
|
20 |
|
|
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
ngOnInit() {
|
24 |
|
|
}
|
25 |
|
|
|
26 |
|
|
@Input()
|
27 |
|
|
set userType(userType: string) {
|
28 |
|
|
this._userType = UserType.EMPLOYEE;
|
29 |
|
|
console.log('intercepted ' + this._userType);
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
onConfirmClick(): void {
|
33 |
|
|
this.dialogRef.close();
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
onCloseClick(): void {
|
38 |
|
|
this.dialogRef.close();
|
39 |
|
|
}
|
40 |
|
|
|
41 |
|
|
}
|