|
|
|
@ -19,6 +19,7 @@ import { Subject } from 'rxjs/Subject';
|
|
|
|
|
import { Subscription } from 'rxjs/Subscription';
|
|
|
|
|
import {forEach} from '@angular/router/src/utils/collection';
|
|
|
|
|
import { AuthService } from '../../../services/auth/auth.service';
|
|
|
|
|
import { ToastrService } from '../../../typescripts/angular-bootstrap-md/pro';
|
|
|
|
|
import * as _ from 'lodash';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@ -75,7 +76,7 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
filters = {};
|
|
|
|
|
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
|
|
|
|
|
private router: Router, private route: ActivatedRoute,
|
|
|
|
|
private authService: AuthService, private opComService: OpCommercialService) {
|
|
|
|
|
private authService: AuthService, private opComService: OpCommercialService, private toastrService: ToastrService) {
|
|
|
|
|
this.user = afAuth.authState;
|
|
|
|
|
this.carteExitDeja = false;
|
|
|
|
|
this.carteEnvoieOK = false;
|
|
|
|
@ -289,10 +290,12 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
this.getIdParrain(elementParTemp.uid);
|
|
|
|
|
this.creerCartePar();
|
|
|
|
|
this.carteEnvoieOK = true;
|
|
|
|
|
this.toastrService.success('Envoie de la carte à ' + elementParTemp.familyname + ' ' + elementParTemp.firstname);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
registerNewParrain() {
|
|
|
|
@ -437,6 +440,7 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
console.log('cestBon !!');
|
|
|
|
|
this.creerCartePar();
|
|
|
|
|
this.carteEnvoieOK = true;
|
|
|
|
|
this.toastrService.success('Envoie de la carte à ' + this.cartePar.parrainCarte.familyname + ' ' + this.cartePar.parrainCarte.firstname);
|
|
|
|
|
}else{
|
|
|
|
|
console.log('cest pas bon ');
|
|
|
|
|
//this.carteEnvoieOK = false;
|
|
|
|
@ -501,7 +505,6 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
envoyerCartePar(){
|
|
|
|
|
this.carteExist(this.cartePar.parrainCarte.uid);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.goToOpComm();
|
|
|
|
|
}
|
|
|
|
|
creerCartePar() {
|
|
|
|
|