private void BtnLogon_Click(object sender, EventArgs e) { if (TxtUsername.Text == "" || TxtPassword.Text == "") { TraceBox.Text += "Please enter a username and password.\r\n"; return; } if (webAPIconnect != null && webAPIconnect.isLoggedOn()) { TraceBox.Text += "Please log off before logging on again.\r\n"; return; } TraceBox.Text += "Logging on... \r\n"; webAPIconnect = new WebAPIconnection(TxtUsername.Text, TxtPassword.Text, TxtURI.Text); int result = webAPIconnect.Logon(); if (result != 0) { TraceBox.Text += "Logon failed. Error: " + result.ToString() + "\r\n"; } else { TraceBox.Text += "Logon successful.\r\n"; this.docOperation = new DocOperation(webAPIconnect); } }
public DocOperation(WebAPIconnection webAPIconnect) { this.webAPIconnect = webAPIconnect; }