Merge branch 'anis' of ssh://git.marbelium.com:10023/Viiciouss/XJC into thierry

thierry
Tmadkaud 7 years ago
commit 4fb99acc1d

@ -10,6 +10,7 @@ import { AngularFireAuth } from 'angularfire2/auth';
import { AuthService } from '../../../services/auth/auth.service';
import { OpCommercialService } from '../../../services/opCommercial/op-commercial.service';
import { Commercant } from '../../../../models/Commercant';
import { ToastrService } from '../../../typescripts/angular-bootstrap-md/pro';
@Component({
selector: 'app-demande-op-commercial',
@ -28,7 +29,7 @@ export class DemandeOpCommercialComponent implements OnInit, OnDestroy {
tarifXJCParr: number;
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private authService: AuthService, private opComService: OpCommercialService) {
private router: Router, private authService: AuthService, private opComService: OpCommercialService, private toastrService: ToastrService) {
this.opComm = new OperationCommerciale();
this.databaseRef = firebase.database().ref();
this.user = afAuth.authState;
@ -66,6 +67,8 @@ export class DemandeOpCommercialComponent implements OnInit, OnDestroy {
const opEnvRef = this.databaseRef.child('OperationCommercial').child(opRejeter.uid).child('validationXJC');
opEnvRef.set('Rejeté');
this.tarifXJCParr = 0;
this.toastrService.success("L'opération commerciale : " + opRejeter.name + ' a été rejetée ' );
}
valider(opValider: OperationCommerciale) {
@ -77,6 +80,8 @@ export class DemandeOpCommercialComponent implements OnInit, OnDestroy {
const opEnvRef = this.databaseRef.child('OperationCommercial').child(opValider.uid).child('validationXJC');
opEnvRef.set('Validé');
this.tarifXJCParr = 0;
this.toastrService.success("L'opération commerciale : " + opValider.name + ' a été validée ' );
}

@ -7,6 +7,8 @@ import { Observable } from 'rxjs/Observable';
import { OperationCommerciale } from '../../../../models/OperationCommerciale';
// import { AngularFire, FirebaseListObservable } from 'angularfire2';
import { AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable } from 'angularfire2/database';
import { ToastrService } from '../../../typescripts/angular-bootstrap-md/pro';
import * as firebase from 'firebase/app';
import { AngularFireAuth } from 'angularfire2/auth';
@ -44,7 +46,7 @@ export class CreationOpComComponent implements OnInit, OnDestroy {
devise: string;
devise2: string;
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private authService: AuthService, private opComService: OpCommercialService) {
private router: Router, private authService: AuthService, private opComService: OpCommercialService, private toastrService: ToastrService) {
this.opComm = new OperationCommerciale();
this.devise = 'euro';
this.devise2 = 'euro';
@ -57,6 +59,7 @@ export class CreationOpComComponent implements OnInit, OnDestroy {
this.todayDateTimeTest = new Date(Date.now());
}
creerOpComm() {
this.user.subscribe(
@ -89,7 +92,7 @@ export class CreationOpComComponent implements OnInit, OnDestroy {
}
}
);
this.toastrService.success("Création d'une nouvelle opération commerciale: " + this.opComm.name);
}
validationDateDebut(){
@ -129,6 +132,7 @@ export class CreationOpComComponent implements OnInit, OnDestroy {
this.devise2 = devise;
}
ngOnInit() {
try {
this.user.subscribe(

@ -19,6 +19,8 @@ import { Subscription } from 'rxjs/Subscription';
import { AuthService } from '../../../services/auth/auth.service';
import { Filleul } from '../../../../models/Filleul';
import { Scan } from '../../../../models/Scan';
import { ToastrService } from '../../../typescripts/angular-bootstrap-md/pro';
@Component({
selector: 'app-debiter-carte',
@ -64,7 +66,7 @@ export class DebiterCarteComponent implements OnInit, OnDestroy {
/////
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private authService: AuthService,
private opComService: OpCommercialService, private route: ActivatedRoute) {
private opComService: OpCommercialService, private route: ActivatedRoute, private toastrService: ToastrService) {
this.radioParrain = '';
this.ParrainCarteSelect = '';
this.localUser = new User();
@ -174,6 +176,8 @@ export class DebiterCarteComponent implements OnInit, OnDestroy {
const crtHistoriqueRef = this.databaseRef.child('CarteParrainage').child(this.cartePar.uid.toString()).child('historique');
crtHistoriqueRef.set(this.cartePar.historique);
this.goToOpComm();
this.toastrService.success('Débit de la carte de : ' + this.cartePar.parrainCarte.familyname + ' ' + this.cartePar.parrainCarte.firstname);
}
filter(query: string) {
this.filteredParrainsTest = (query) ?

@ -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() {

@ -13,6 +13,7 @@ import { OpCommercialService } from '../../../services/opCommercial/op-commercia
import { Commercant } from '../../../../models/Commercant';
import {CarteParrainage} from "../../../../models/CarteParrainage";
@Component({
selector: 'app-op-commercial',
templateUrl: './op-commercial.component.html',

@ -19,6 +19,8 @@ import { Subscription } from 'rxjs/Subscription';
import { AuthService } from '../../../services/auth/auth.service';
import { Filleul } from '../../../../models/Filleul';
import { Scan } from '../../../../models/Scan';
import { ToastrService } from '../../../typescripts/angular-bootstrap-md/pro';
@Component({
selector: 'app-scanner-carte',
@ -65,7 +67,7 @@ export class ScannerCarteComponent implements OnInit, OnDestroy {
/////
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private authService: AuthService,
private opComService: OpCommercialService, private route: ActivatedRoute) {
private opComService: OpCommercialService, private route: ActivatedRoute, private toastrService: ToastrService) {
this.isFilleulAnonyme = false;
this.radioFilleul = '';
this.filleulSelect = '';
@ -187,6 +189,7 @@ export class ScannerCarteComponent implements OnInit, OnDestroy {
this.updateCarte();
this.goToOpComm();
this.toastrService.success('Scan du filleul ' + this.filleul.familyname + ' ' + this.filleul.firstname);
}
filleulAnonymous() {

Loading…
Cancel
Save