Skip to content

Commit

Permalink
Fixed a small bug that was beginning caused by string value not being…
Browse files Browse the repository at this point in the history
… trimmed
  • Loading branch information
iWig committed Jan 30, 2017
1 parent 9ae4bb9 commit e72a9ac
Show file tree
Hide file tree
Showing 28 changed files with 11,758 additions and 9 deletions.
Binary file modified .vs/FCCULSDataGrabber/v14/.suo
Binary file not shown.
19 changes: 10 additions & 9 deletions FCCULSDataGrabber/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ private void GenerateCSVFile()
if (!DataFound && SelectCallSignMatchItem.Value != -1 && !DataStringLists[SelectCallSignMatchItem.Value][x].Equals(""))
{
CurrentlySearchingFor.Text = "Searching: " + DataStringLists[SelectCallSignMatchItem.Value][x].ToString();
string url = "http://data.fcc.gov/api/license-view/basicSearch/getLicenses?searchValue=" + DataStringLists[SelectCallSignMatchItem.Value][x] + "&format=json&pageSize=1000";
//string url = "http://data.fcc.gov/api/license-view/basicSearch/getLicenses?searchValue=KE8FHQ&format=json";
//string url = "http://data.fcc.gov/api/license-view/basicSearch/getLicenses?searchValue=" + DataStringLists[SelectCallSignMatchItem.Value][x] + "&format=json&pageSize=1000";
string url = "http://data.fcc.gov/api/license-view/basicSearch/getLicenses?searchValue=N8AM&format=json";
Console.Write("Testing");
string text = GetDataReponseFromFCCAPI(url);
dynamic stuff = JsonConvert.DeserializeObject(text);
//MessageBox.Show(DataStringLists[2][x]);
Expand All @@ -174,12 +175,13 @@ private void GenerateCSVFile()
if (!stuff.status.Value.Equals("OK"))
{
//TODO: Handle Error Here
Console.Write("Error");
} else
{
//We Found Data. We Could Have Mulitple Results Returned Here
DataFound = true;
int NumOfResultReturned = stuff.Licenses.totalRows;

Console.Write(NumOfResultReturned);
if (NumOfResultReturned > 1)
{
//We Have Multiple Results
Expand Down Expand Up @@ -448,6 +450,7 @@ private void ParseDataToLists(dynamic LicenseData)
}
private List<dynamic> SearchInMultipleItems(dynamic JSONResponse, string SearchValue, string SearchType)
{

dynamic LicenseData = JSONResponse.Licenses.License;
int Count = JSONResponse.Licenses.totalRows;
List<dynamic> FoundResults = new List<dynamic>();
Expand All @@ -459,20 +462,18 @@ private List<dynamic> SearchInMultipleItems(dynamic JSONResponse, string SearchV

if (SearchType.Equals("CallSign"))
{
//We Are Searching Via a Callsign

if (LicenseData[u].callsign.Value.ToString().Equals(SearchValue))

if (LicenseData[u].callsign.Value.ToString().Trim().Equals(SearchValue.Trim()))
{
//Value Found Add To The List
FoundResults.Add(LicenseData[u]);

}

}
else if (SearchType.Equals("FRN"))
{
//We Are Searching Via a FRN
if (LicenseData[u].frn.Value.ToString().Equals(SearchValue))
if (LicenseData[u].frn.Value.ToString().Trim().Equals(SearchValue.Trim()))
{
//Value Found Add To The List
FoundResults.Add(LicenseData[u]);
Expand All @@ -482,7 +483,7 @@ private List<dynamic> SearchInMultipleItems(dynamic JSONResponse, string SearchV
else if (SearchType.Equals("Name"))
{
//We Are Searching Via a Name
if (LicenseData[u].licName.Value.ToString().Equals(SearchValue))
if (LicenseData[u].licName.Value.ToString().Trim().Equals(SearchValue.Trim()))
{
//Value Found Add To The List
FoundResults.Add(LicenseData[u]);
Expand Down
Binary file modified FCCULSDataGrabber/bin/Debug/FCCULSDataGrabber.exe
Binary file not shown.
Binary file modified FCCULSDataGrabber/bin/Debug/FCCULSDataGrabber.pdb
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions FCCULSDataGrabber/bin/Release/FCCULSDataGrabber.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit e72a9ac

Please sign in to comment.