|
|
@ -24,6 +24,7 @@ export class CollaborateurEditComponent implements OnInit { |
|
|
|
collaborateurs : Collaborateur[] = []; |
|
|
|
collaborateurs : Collaborateur[] = []; |
|
|
|
businessUnits : Businessunit[] = []; |
|
|
|
businessUnits : Businessunit[] = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
errorValue : number = 0; |
|
|
|
rDate : String = ""; |
|
|
|
rDate : String = ""; |
|
|
|
bDate : String = ""; |
|
|
|
bDate : String = ""; |
|
|
|
|
|
|
|
|
|
|
@ -52,8 +53,8 @@ export class CollaborateurEditComponent implements OnInit { |
|
|
|
childrenNumber: ['', Validators.required], |
|
|
|
childrenNumber: ['', Validators.required], |
|
|
|
address: ['', Validators.required], |
|
|
|
address: ['', Validators.required], |
|
|
|
telephone: ['', Validators.required], |
|
|
|
telephone: ['', Validators.required], |
|
|
|
personalMail: ['',Validators.compose([Validators.required,Validators.pattern(".*@[a-z]*\.[a-z]*")])], |
|
|
|
personalMail: ['',Validators.compose([Validators.required,Validators.pattern(".+@[a-z]*\.[a-z]*")])], |
|
|
|
apsideMail: ['', Validators.compose([Validators.required,Validators.pattern(".*@apside-groupe\.com|.*@apside\.fr")])], |
|
|
|
apsideMail: ['', Validators.compose([Validators.required,Validators.pattern(".+@apside-groupe\.com|.*@apside\.fr")])], |
|
|
|
resignationDate: ['', Validators.required], |
|
|
|
resignationDate: ['', Validators.required], |
|
|
|
referrerId: ['', Validators.required], |
|
|
|
referrerId: ['', Validators.required], |
|
|
|
businessUnitId: ['', Validators.required], |
|
|
|
businessUnitId: ['', Validators.required], |
|
|
@ -110,12 +111,20 @@ export class CollaborateurEditComponent implements OnInit { |
|
|
|
this.collaborateur.childrenNumber = this.registerForm.value.childrenNumber |
|
|
|
this.collaborateur.childrenNumber = this.registerForm.value.childrenNumber |
|
|
|
this.collaborateur.status = this.registerForm.value.status |
|
|
|
this.collaborateur.status = this.registerForm.value.status |
|
|
|
|
|
|
|
|
|
|
|
if (this.collaborateur){ |
|
|
|
if (this.collaborateur) { |
|
|
|
this.collaborateurService.updateCollaborateur(this.collaborateur) |
|
|
|
this.collaborateurService.updateCollaborateur(this.collaborateur).subscribe({ |
|
|
|
.subscribe(()=>this.goBack()); |
|
|
|
next: () => { |
|
|
|
|
|
|
|
this.goBack(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
error: () => { |
|
|
|
|
|
|
|
this.errorValue = 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get f() { return this.registerForm.controls; } |
|
|
|
get f() { return this.registerForm.controls; } |
|
|
|
|
|
|
|
|
|
|
|
onReset() { |
|
|
|
onReset() { |
|
|
|