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 revision
Previous 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:21] – [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 68: Line 69:
                     /// and Document Type Setup windows.  In the SOP module, invoices are                      /// and Document Type Setup windows.  In the SOP module, invoices are 
                     /// docType 3.                     /// docType 3.
 +                    /// (The SOP module can be setup automatically using 
 +                    /// File > Create SOP in the TE Transaction Source Modules window.)
                     Int16 docType = 3;                     Int16 docType = 3;
                     string module = "SOP";                     string module = "SOP";
Line 152: Line 155:
                                     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 166:
                             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 173:
                                     if (city == "")                                     if (city == "")
                                     {                                     {
-                                        cityNotChosen false;+                                        cityChosen true//Accepting the current value
                                     }                                     }
                                     else                                     else
Line 176: Line 180:
                                         {                                         {
                                             txEngn.LineCity = city;                                             txEngn.LineCity = city;
-                                            cityNotChosen false;+                                            cityChosen true;
                                         }                                         }
                                         catch (Exception e)                                         catch (Exception e)
Line 185: Line 189:
                                 }                                 }
                             }                             }
- +                            // 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 199:
                             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 206:
                                     if (county == "")                                     if (county == "")
                                     {                                     {
-                                        countyNotChosen false;+                                        countyChosen true//Accepting the current value
                                     }                                     }
                                     else                                     else
Line 209: Line 213:
                                         {                                         {
                                             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