|
|
|
@ -63,11 +63,13 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
minDateTimeTest: Date;
|
|
|
|
|
maxDateTimeTest: Date;
|
|
|
|
|
parrainDateTimeTest: Date;
|
|
|
|
|
|
|
|
|
|
carteExitDeja: boolean;
|
|
|
|
|
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
|
|
|
|
|
private router: Router, private route: ActivatedRoute,
|
|
|
|
|
private authService: AuthService, private opComService: OpCommercialService) {
|
|
|
|
|
this.user = afAuth.authState;
|
|
|
|
|
|
|
|
|
|
this.carteExitDeja = false;
|
|
|
|
|
|
|
|
|
|
this.radioParrain = '';
|
|
|
|
|
this.validC = '';
|
|
|
|
@ -316,6 +318,23 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.parrain = elementPaSel;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
////////// not working
|
|
|
|
|
this.carteParList.forEach(carte => {
|
|
|
|
|
carte.forEach(elementCarte => {
|
|
|
|
|
if (elementCarte.parrainCarte.uid === this.cartePar.parrainCarte.uid) {
|
|
|
|
|
this.carteExitDeja = true;
|
|
|
|
|
console.log('eeeeeeeeeeeeeeeeeeeeee');
|
|
|
|
|
}
|
|
|
|
|
if (this.carteExitDeja === false){
|
|
|
|
|
//this.creerCartePar();
|
|
|
|
|
console.log('exist pas');
|
|
|
|
|
} else if (this.carteExitDeja === true){
|
|
|
|
|
// this.creerCartePar();
|
|
|
|
|
console.log('exist');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
// console.log('this.birthday parrain : ' + this.parrain.birthday);
|
|
|
|
|
console.log('this.cartePar.commercantCarte.uid : ' + this.cartePar.commercantCarte.uid);
|
|
|
|
|
console.log('this.cartePar..parrainCarte.uid : ' + this.cartePar.parrainCarte.uid);
|
|
|
|
@ -389,8 +408,6 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
goToOpComm() {
|
|
|
|
|
this.router.navigate(['/opCommercial']);
|
|
|
|
|
}
|
|
|
|
|