taxengine:integration:code_samples:c_sample_code
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
taxengine:integration:code_samples:c_sample_code [2015/06/30 18:11] – conni | taxengine:integration:code_samples:c_sample_code [2015/08/06 17:16] – [Console App in C#] chuck | ||
---|---|---|---|
Line 37: | Line 37: | ||
string password = " | string password = " | ||
string companyDatabase = " | string companyDatabase = " | ||
+ | string systemDatabase = " | ||
Int16 timeOutSeconds = 60; | Int16 timeOutSeconds = 60; | ||
bool displayProgessBar = true; | bool displayProgessBar = true; | ||
Line 49: | Line 50: | ||
/// The Portal.Login method makes the connection to SQL Server and | /// The Portal.Login method makes the connection to SQL Server and | ||
/// prepares the TaxEngine for use. | /// prepares the TaxEngine for use. | ||
- | loginMessage = txEngn.Login(server, | + | loginMessage = txEngn.Login(server, |
} | } | ||
catch (Exception e) | catch (Exception e) | ||
Line 152: | Line 153: | ||
txEngn.LineState = state; | txEngn.LineState = state; | ||
} | } | ||
+ | // Fetch the default tax schedule for this state and zip. | ||
+ | txEngn.LineTaxScheduleSelect(); | ||
cities = txEngn.LineCitiesInStateAndZip(); | cities = txEngn.LineCitiesInStateAndZip(); | ||
Console.WriteLine(" | Console.WriteLine(" | ||
Line 162: | Line 164: | ||
if (cities.Count > 1) | if (cities.Count > 1) | ||
{ | { | ||
- | bool cityNotChosen | + | bool cityChosen |
- | while (cityNotChosen) | + | while (!cityChosen) |
{ | { | ||
Console.WriteLine(" | Console.WriteLine(" | ||
Line 169: | Line 171: | ||
if (city == "" | if (city == "" | ||
{ | { | ||
- | | + | |
} | } | ||
else | else | ||
Line 176: | Line 178: | ||
{ | { | ||
txEngn.LineCity = city; | txEngn.LineCity = city; | ||
- | | + | |
} | } | ||
catch (Exception e) | catch (Exception e) | ||
Line 185: | Line 187: | ||
} | } | ||
} | } | ||
- | + | // Fetch the default tax schedule for this city state and zip. | |
- | counties = txEngn.LineCountiesInCityStateAndZip(); | + | txEngn.LineTaxScheduleSelect(); |
- | Console.WriteLine(" | + | counties = txEngn.LineCountiesInState(); |
- | txEngn.LineCity, txEngn.LineState, txEngn.LineZip); | + | Console.WriteLine(" |
foreach (string county in counties) | foreach (string county in counties) | ||
{ | { | ||
Line 195: | Line 197: | ||
if (counties.Count > 1) | if (counties.Count > 1) | ||
{ | { | ||
- | bool countyNotChosen | + | bool countyChosen |
- | while (countyNotChosen) | + | while (!countyChosen) |
{ | { | ||
Console.WriteLine(" | Console.WriteLine(" | ||
Line 202: | Line 204: | ||
if (county == "" | if (county == "" | ||
{ | { | ||
- | | + | |
} | } | ||
else | else | ||
Line 209: | Line 211: | ||
{ | { | ||
txEngn.LineCounty = county; | txEngn.LineCounty = county; | ||
- | | + | |
} | } | ||
catch (Exception e) | catch (Exception e) |
taxengine/integration/code_samples/c_sample_code.txt · Last modified: 2015/08/06 20:00 by chuck