/ Published in: JavaScript
Expand |
Embed | Plain Text
getExemptionBoard : function(documentid){ var ex = new ExemptionBoard(); var exemptions = horton.exempt.getExemptionInfo(documentid); ex.exemptions = exemptions; //do length check ex.locations = horton.services.locationService.getAllItems() ; var profile = new PageDataManager("profile",documentid); //Get all the ExemptionLocations and add them as needed, rather than a query for each since we are opening and closing connections: var tempExemtLocations = quickQuery("SELECT Location_Amt, Position_ID, Location_ID FROM PHD_MM_ExemptionsLocations WHERE Document_ID = ?", [documentid]); for(var i = 0; i < ex.exemptions.length; i++){ ex.exemptions[i].profile = profile; ex.exemptions[i].locations = []; for(var l = 0; l < ex.locations.length; l++){ var exemptionInfo = {} exemptionInfo.location = ex.locations[l]; exemptionInfo.location_id = ex.locations[l].location_id; exemptionInfo.exempt_val = 0; //Go find the right one in the previous array for(var e = 0; e < tempExemtLocations.length; e++){ if((tempExemtLocations[e].location_id == ex.locations[l].location_id) && (tempExemtLocations[e].position_id == i+1)){ exemptionInfo.exempt_val = tempExemtLocations[e].location_amt; break; //Found it, done. } } ex.exemptions[i].locations.push(exemptionInfo); //We go and get the ExemptionLocation Value } } return ex; },
You need to login to post a comment.
