private generateCreateTableStatement(csvData) {
        let rows = csvData.split('\n');
        let fieldList = rows[0].replace(/"/g,'');
        let fields = fieldList.split(',');

        let sql = '-- DROP TABLE IF EXISTS workspace.' + this.tableName + ';\n\n';
        sql += 'CREATE TABLE workspace.' + this.tableName + '(\n';

        for (let i = 0; i < fields.length; i++) {
            sql += '\t' + fields[i] + ' CHARACTER VARYING(255),\n';
        }
        sql += '\tCONSTRAINT pk_'+this.tableName+'_'+fields[0]+' PRIMARY KEY ('+fields[0]+')\n';
        sql += ');\n\n';

        sql += 'INSERT INTO workspace.' + this.tableName + '\n';
        sql += '(' + fieldList + ')\n';
        sql += 'VALUES';

        for (let i = 1; i < rows.length; i++) {
            if (i > 1)
                sql += ',';
            sql += '\n(' + rows[i].replace(/"/g,"'") + ')';
        }
        sql += ';';

        this.activeModal.close(sql);
    }
 /// *** Event handlers *************************************************
 /**
  * Guarda los cambios para el pago mensual
  * 
  * @memberOf EditarPagoComponent
  */
 GuardarCambios():void {
     this.activeModal.close();
     const modalRef = this.modalService.open(framework.ProgresoModal);
     modalRef.componentInstance.Mensaje = "Guardando pago";
     this.planillaService.ActualizarPago(this.PagoMensual)
      .subscribe(result => { modalRef.close() }, 
                 error => { 
                      modalRef.close();
                     console.log(error); 
                 });  
 }
  // send price to parent component
 sendPrice(){
   if(this.price != null){ // check if the user entered price
     this.boughtInputModalService.neededPriceChange.emit(this.price);
     this.activeModal.close(); //close modal
   }
   else if(this.price== null ){
     this.errorMessage = "Item Price missing";
   }    
 }
 execute(form: NgForm) : void {
     let variables: EnvironmentVariable[] = [];
     this.workflow.referenced_variables.forEach(variable => {
         if (form.value[variable.id] && form.value[variable.id] != '') {
             let newV = new EnvironmentVariable();
             newV.id = variable.id;
             newV.value = form.value[variable.id];
             variables.push(newV);
         }
     })
     this.activeModal.close(variables);
 }
 creerVehicule() {
   const newVehicule = new VehiculeSociete(
     this.immatriculation.value,
     this.marque.value,
     this.modele.value,
     this.categorie.value,
     this.nbPlaces.value,
     this.photo.value
   );
   console.log('publish : ', newVehicule);
   this.ds.publishVehicule(newVehicule).subscribe(veh => {
     console.log('response to publish : ', veh);
   });
   this.activeModal.close();
 }
 private onSubmit() {
     if (this.form.valid) {
         const item = this.item
             ? new NameListItem(
                 this.firstName,
                 this.lastName,
                 this.email,
                 this.item.id,
                 this.item.readUri,
                 this.item.updateUri,
                 this.item.deleteUri)
             : new NameListItem(
                 this.firstName,
                 this.lastName,
                 this.email);
         this.activeModal.close(item);
     }
 }
 this.userService.delete(login).subscribe(response => {
   this.eventManager.broadcast({ name: 'userListModification', content: 'Deleted a user' });
   this.activeModal.close(true);
 });
 confirmDelete() {
     this.activeModal.close(true);
 }
 cancelModal() {
   this.activeModal.close('N');
 }
				.then(user => this.activeModal.close({
					user,
					isEdit: false,
				}))