Skip to content

Initialise client

lasalesi edited this page Jun 13, 2017 · 1 revision

Initialisation of a client

Include the following using statements (as well as required further DocTypes by group) using ERPNextSharp; using ERPNextSharp.Data; using ERPNext.DocTypes.Customer;

Make sure you define globally private ERPNextClient client;

Then, initialise like this client = new ERPNextClient(txtServer.Text, txtUsername.Text, txtPassword.Text); client.HasError += Client_HasError;

if (client.IsLoggedIn)
{
	postLoginHooks();
}
else
{
	MessageBox.Show("Unable to connect.");
}

Clone this wiki locally