User Tools

Site Tools


taxengine:integration:code_samples:c_sample_code

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
taxengine:integration:code_samples:c_sample_code [2015/06/30 18:11] connitaxengine:integration:code_samples:c_sample_code [2015/08/06 17:16] – [Console App in C#] chuck
Line 37: Line 37:
             string password = "p@ssw0rd";             string password = "p@ssw0rd";
             string companyDatabase = "TWO";             string companyDatabase = "TWO";
 +            string systemDatabase = "DYNAMICS";
             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, userId, password, companyDatabase, timeOutSeconds, displayProgessBar);+                    loginMessage = txEngn.Login(server, userId, password, systemDatabase, companyDatabase, timeOutSeconds, displayProgessBar);
                 }                 }
                 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("Cities in {0} state and {1} ZIP:",                             Console.WriteLine("Cities in {0} state and {1} ZIP:",
Line 162: Line 164:
                             if (cities.Count > 1)                             if (cities.Count > 1)
                             {                             {
-                                bool cityNotChosen true+                                bool cityChosen false
-                                while (cityNotChosen)+                                while (!cityChosen)
                                 {                                 {
                                     Console.WriteLine("Enter a city. Press enter for {0}", txEngn.LineCity);                                     Console.WriteLine("Enter a city. Press enter for {0}", txEngn.LineCity);
Line 169: Line 171:
                                     if (city == "")                                     if (city == "")
                                     {                                     {
-                                        cityNotChosen false;+                                        cityChosen true//Accepting the current value
                                     }                                     }
                                     else                                     else
Line 176: Line 178:
                                         {                                         {
                                             txEngn.LineCity = city;                                             txEngn.LineCity = city;
-                                            cityNotChosen false;+                                            cityChosen true;
                                         }                                         }
                                         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 in {0}, {1} {2}:"+                            counties = txEngn.LineCountiesInState(); 
-                            txEngn.LineCity, txEngn.LineState, txEngn.LineZip);+                            Console.WriteLine("Counties in {0}:", txEngn.LineState);
                             foreach (string county in counties)                             foreach (string county in counties)
                             {                             {
Line 195: Line 197:
                             if (counties.Count > 1)                             if (counties.Count > 1)
                             {                             {
-                                bool countyNotChosen true+                                bool countyChosen false
-                                while (countyNotChosen)+                                while (!countyChosen)
                                 {                                 {
                                     Console.WriteLine("Enter a county. Press enter for {0}", txEngn.LineCounty);                                     Console.WriteLine("Enter a county. Press enter for {0}", txEngn.LineCounty);
Line 202: Line 204:
                                     if (county == "")                                     if (county == "")
                                     {                                     {
-                                        countyNotChosen false;+                                        countyChosen true//Accepting the current value
                                     }                                     }
                                     else                                     else
Line 209: Line 211:
                                         {                                         {
                                             txEngn.LineCounty = county;                                             txEngn.LineCounty = county;
-                                            countyNotChosen false;+                                            countyChosen true;
                                         }                                         }
                                         catch (Exception e)                                         catch (Exception e)
taxengine/integration/code_samples/c_sample_code.txt · Last modified: 2015/08/06 20:00 by chuck

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki