Skip to content

Instantly share code, notes, and snippets.

@amarodeabreu
Created February 23, 2021 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amarodeabreu/d18ff61bfa943d0880ce7b7764ba283f to your computer and use it in GitHub Desktop.
Save amarodeabreu/d18ff61bfa943d0880ce7b7764ba283f to your computer and use it in GitHub Desktop.
/// <summary>
/// Do SYSPRO login
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <param name="company"></param>
/// <param name="companyPassword"></param>
/// <returns>XmlDocument</returns>
public static void DoLogin(
string userName,
string password,
string company,
string companyPassword)
{
//the binding to use
var clientPrim = new SYSPROWCFServicesPrimitiveClient(Properties.Settings.Default.WCF_Rest, SYSPROWCFBinding.NetTcp);
// Subscribe to the logon call back event
clientPrim.LogonCallBack += LogonCallBack;
//Finally call the Asynchronous method for logon
clientPrim.LogonAsync(userName, password, company, companyPassword, "", "", Properties.Settings.Default.SYSPROInstance, "");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment