Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Nuevo
- //Tabla Perfil
- var cantFilasMF = document.getElementById("MODINVFONDO").rows.length;
- let mapPerfilFondo = new Map();
- for (var i =1; i < cantFilasMF; i++){
- tableModFond = document.getElementById("MODINVFONDO");
- rowMod1 = tableModFond.rows[i].cells[1].textContent;
- var index = rowMod1.indexOf("-");
- rowMod1 = rowMod1.substring(0,(index));
- rowMod1.trim();
- mapPerfilFondo.set('Santander A', 30); // a string key
- //mapPerfilFondo.set(rowMod1, tableModFond.rows[i].cells[2].textContent);
- alert(tableModFond.rows[i].cells[2].textContent);
- //alert("Fondo Origen map-->"+ mapPerfilFondo.get(values));
- }
- //mapPerfilFondo.set('Santander A', 'A'); // a string key
- //mapPerfilFondo.set('Santander B', 'B'); // a numeric key
- //mapPerfilFondo.set('Santander C', 'Cd'); // a boolean key
- //Tabla Nuevo Perfil
- var cantFilasNMPF = document.getElementById("TABPREFDIST").rows.length;
- let mapNuevoPerfilFondo = new Map();
- for (var i =1; i < cantFilasNMPF; i++){
- tableModFond = document.getElementById("TABPREFDIST");
- var mylist = document.getElementById("selFonD_"+(i-1));
- var rowMod1 = mylist.options[mylist.selectedIndex].textContent;
- //alert("Nuevo Fondo Destino-->"+rowMod1);
- mapNuevoPerfilFondo.set('Santander A', 'A'); // a string key
- mapNuevoPerfilFondo.set('Santander B', 'B'); // a numeric key
- mapNuevoPerfilFondo.set('Santander C', 'C'); // a numeric key
- mapNuevoPerfilFondo.set('Santander D', 30); // a numeric key
- }
- var sizeMPF;
- sizeMPF = mapPerfilFondo.size
- //alert("mpf size -->"+sizeMPF);
- var values_PF = mapPerfilFondo.values();
- var sizeNMPF;
- sizeNMPF = mapNuevoPerfilFondo.size
- //alert("nmpf size -->"+sizeNMPF);
- var values_NMPF = mapNuevoPerfilFondo.values();
- //Comparar Fondos
- var nocoincide=0;
- for (var i =0; i < sizeMPF; i++){
- iterarNMPF(values_PF.next().value);
- }
- function iterarNMPF(pf){
- for (var j =0; j < sizeNMPF; j++){
- //alert(" PF "+ pf +" NMPF "+ values_NMPF.next().value);
- var tmpNMPF = values_NMPF.next().value;
- if(pf != tmpNMPF){
- //alert(" PF: "+ pf +" y NMPF: "+ tmpNMPF+ ", No Son iguales ");
- nocoincide+=1;
- }
- }
- values_NMPF = mapNuevoPerfilFondo.values();
- }
- alert(" Coinciden: "+ ((sizeMPF*sizeNMPF)- nocoincide));
- if(nocoincide==(sizeMPF*sizeNMPF)){
- alert("Ningún Fondo de destino se encuentra en Lista de Perfil");
- }
- else {
- alert("Algún Fondo de destino si se encuentra en Lista de Perfil");
- }
- //Fin Comparar Fondos
- //Fin Nuevo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement