Skip to content

Commit

Permalink
Merge pull request #157 from FutureNorthants/beta
Browse files Browse the repository at this point in the history
Closes #150
  • Loading branch information
KevinWhite authored Jul 7, 2021
2 parents 03ce7fd + 9264d1a commit 942c98b
Showing 1 changed file with 109 additions and 48 deletions.
157 changes: 109 additions & 48 deletions CheckForLocation/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -721,60 +721,121 @@ private async Task<Location> CheckForLocationAsync(String emailBody)
return sovereignLocation;
}

if (emailBody.ToLower().Contains("northampton")||await IsInArea(emailBody.ToLower(),"LocationsNorthampton"))
if (west)
{
sovereignLocation.SovereignCouncilName = "Northampton";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("towcester") || await IsInArea(emailBody.ToLower(), "LocationsSouthNorthants"))
{
sovereignLocation.SovereignCouncilName = "south_northants";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}
if (emailBody.ToLower().Contains("northampton") || await IsInArea(emailBody.ToLower(), "LocationsNorthampton"))
{
sovereignLocation.SovereignCouncilName = "Northampton";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("daventry") || await IsInArea(emailBody.ToLower(), "LocationsDaventry"))
{
sovereignLocation.SovereignCouncilName = "Daventry";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("wellingborough") || await IsInArea(emailBody.ToLower(), "LocationsWellingborough"))
{
sovereignLocation.SovereignCouncilName = "Wellingborough";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}
if (emailBody.ToLower().Contains("towcester") || await IsInArea(emailBody.ToLower(), "LocationsSouthNorthants"))
{
sovereignLocation.SovereignCouncilName = "south_northants";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("kettering") || await IsInArea(emailBody.ToLower(), "LocationsKettering"))
{
sovereignLocation.SovereignCouncilName = "Kettering";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}
if (emailBody.ToLower().Contains("daventry") || await IsInArea(emailBody.ToLower(), "LocationsDaventry"))
{
sovereignLocation.SovereignCouncilName = "Daventry";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("corby") || await IsInArea(emailBody.ToLower(), "LocationsCorby"))
{
sovereignLocation.SovereignCouncilName = "Corby";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
if (emailBody.ToLower().Contains("wellingborough") || await IsInArea(emailBody.ToLower(), "LocationsWellingborough"))
{
sovereignLocation.SovereignCouncilName = "Wellingborough";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("kettering") || await IsInArea(emailBody.ToLower(), "LocationsKettering"))
{
sovereignLocation.SovereignCouncilName = "Kettering";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("corby") || await IsInArea(emailBody.ToLower(), "LocationsCorby"))
{
sovereignLocation.SovereignCouncilName = "Corby";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("rushden") || await IsInArea(emailBody.ToLower(), "LocationsEastNorthants"))
{
sovereignLocation.SovereignCouncilName = "east_northants";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}
}

if (emailBody.ToLower().Contains("rushden") || await IsInArea(emailBody.ToLower(), "LocationsEastNorthants"))
else
{
sovereignLocation.SovereignCouncilName = "east_northants";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
if (emailBody.ToLower().Contains("wellingborough") || await IsInArea(emailBody.ToLower(), "LocationsWellingborough"))
{
sovereignLocation.SovereignCouncilName = "Wellingborough";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("kettering") || await IsInArea(emailBody.ToLower(), "LocationsKettering"))
{
sovereignLocation.SovereignCouncilName = "Kettering";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("corby") || await IsInArea(emailBody.ToLower(), "LocationsCorby"))
{
sovereignLocation.SovereignCouncilName = "Corby";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("rushden") || await IsInArea(emailBody.ToLower(), "LocationsEastNorthants"))
{
sovereignLocation.SovereignCouncilName = "east_northants";
sovereignLocation.sovereignWest = false;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("towcester") || await IsInArea(emailBody.ToLower(), "LocationsSouthNorthants"))
{
sovereignLocation.SovereignCouncilName = "south_northants";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("daventry") || await IsInArea(emailBody.ToLower(), "LocationsDaventry"))
{
sovereignLocation.SovereignCouncilName = "Daventry";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}

if (emailBody.ToLower().Contains("northampton") || await IsInArea(emailBody.ToLower(), "LocationsNorthampton"))
{
sovereignLocation.SovereignCouncilName = "Northampton";
sovereignLocation.sovereignWest = true;
sovereignLocation.Success = true;
return sovereignLocation;
}
}
return sovereignLocation;
}
Expand Down

0 comments on commit 942c98b

Please sign in to comment.