private void bw_SearchEBSContact(object sender, DoWorkEventArgs e) { string logMessage; string logNote; this.isSearchingEBSContact = true; Dictionary<string, string> searchField = (Dictionary<string, string>)e.Argument; string email = searchField["email"]; string phoneDigits = searchField["phone"]; //Send request to EBS Server, if endpoint is set SharedServices.Contact cont = new SharedServices.Contact(); SharedServices.Contact[] results = null; try { results = cont.LookupList(null, null, phoneDigits, email, _logIncidentId, _logContactId); } catch (Exception ex) { // kill the thread (stop the spinner) if EBS api throws exception string message = ex.Message; MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); logMessage = "Error in searching EBS contacts. Cancel Async Thread. Error: " + ex.Message; logNote = ""; _log.ErrorLog(_logIncidentId, _logContactId, logMessage, logNote); e.Cancel = true; return; } if (results.Length > 0 && results[0].ErrorMessage != null) { logMessage = "Response shows error code when searching EBS contacts. email = " + email + "; phone = " + phoneDigits; logNote = ""; _log.ErrorLog(_logIncidentId, _logContactId, logMessage, logNote); e.Cancel = true; return; } e.Result = results; logMessage = "Ebs contact search result. Count = " + results.Length; logNote = ""; _log.DebugLog(_logIncidentId, _logContactId, logMessage, logNote); }
private void bw_SearchSiebelContact(object sender, DoWorkEventArgs e) { string logMessage; string logNote; this.isSearchingSiebelContact = true; Dictionary<string, string> searchField = (Dictionary<string, string>)e.Argument; string email = searchField["email"]; string phoneDigits = searchField["phone"]; string firstname = searchField["firstname"]; string lastname = searchField["lastname"]; //Send request to Siebel Server, if endpoint is set SharedServices.Contact cont = new SharedServices.Contact(); SharedServices.Contact[] results = null; try { results = cont.LookupList(firstname, lastname, phoneDigits, email, _logIncidentId, _logContactId); } catch (Exception ex) { string message = ex.Message; MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // kill the thread (stop the spinner) if Siebel api throws exception logMessage = "Error in searching Siebel contacts. Cancel Async Thread. Error: " + ex.Message; logNote = ""; _log.ErrorLog(_logIncidentId, _logContactId, logMessage, logNote); e.Cancel = true; return; } /****TODO:: if (results.Length > 0 && results[0].ErrorMessage != null) { logMessage = "Response shows error code when searching Siebel contacts. email = " + email + "; phone = " + phoneDigits; logNote = ""; _log.ErrorLog(_logIncidentId, _logContactId, logMessage, logNote); e.Cancel = true; return; } */ e.Result = results; // check for null, otherwise results.Length hit Object Reference not found if (results != null) { logMessage = "Contact search result. Count = " + results.Length; logNote = ""; _log.DebugLog(_logIncidentId, _logContactId, logMessage, logNote); } }