private void btnGoContact_Click_1(object sender, EventArgs e) { try { try { this.cbUserGroup.SelectedIndex = 0; this.cbContactList.SelectedIndex = 0; this.txtSrchUser.Text = ""; } catch (Exception ex1) { } this.listType = 4; ContactService.PsnAPIService local = new ContactService.PsnAPIService(); local.Url = serviceUtil.getPpolURL() + "/cxf/PsnAPI"; ppolContacts = local.search(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword(), this.txtSrcContact.Text); if (ppolContacts != null) { if (ppolContacts.Length > 0) { ContactService.ppolContact ppolCntct = ppolContacts[0]; if (ppolCntct.id == -1) { MessageBox.Show(ppolCntct.errorMessage); } else { this.grdUsers.Rows.Clear(); for (int i = 0; i < ppolContacts.Length; i++) { ContactService.ppolContact contact = ppolContacts[i]; this.grdUsers.Rows.Add(); this.grdUsers.Rows[i].Cells[0].Value = false; this.grdUsers.Rows[i].Cells[1].Value = contact.displayName; this.grdUsers.Rows[i].Cells[2].Value = contact.primaryEmail; } } } } else { if (this.txtSrcContact.Text.Trim() == "") { MessageBox.Show("Contacts are not found in your PlanPlus Online account."); } else { MessageBox.Show("Contact name(s) containing '" + this.txtSrcContact.Text + "' are not found in your PlanPlus Online account."); } } } catch (Exception ex) { ClassFactory.Instance.ConnectionProblem(ex); } }
private void btnGoContact_Click(object sender, EventArgs e) { try { ContactService.PsnAPIService local = new ContactService.PsnAPIService(); local.Url = serviceUtil.getPpolURL() + "/cxf/PsnAPI"; ppolContacts = local.search(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword(), this.txtSrcContact.Text); if (ppolContacts == null || ppolContacts.Length == 0) { if (this.txtSrcContact.Text.Trim() == "") { ShowError("Contacts are not found in your PlanPlus Online account.", MessageBoxIcon.Warning); } else { ShowError("Contact name(s) containing '" + this.txtSrcContact.Text + "' are not found in your PlanPlus Online account.", MessageBoxIcon.Warning); } } else { this.grdUsers.Rows.Clear(); for (int i = 0; i < ppolContacts.Length; i++) { ContactService.ppolContact contact = ppolContacts[i]; if (contact.id < 1) { ShowError(contact.errorMessage); } this.grdUsers.Rows.Add(); this.grdUsers.Rows[i].Cells[0].Value = contact.id; this.grdUsers.Rows[i].Cells[1].Value = contact.displayName; this.grdUsers.Rows[i].Cells[2].Value = contact.primaryEmail; } } } catch (Exception ex) { ClassFactory.Instance.ConnectionProblem(ex); } }
private void loadContactLists(int contactListId) { try { try { this.cbUserGroup.SelectedIndex = 0; this.txtSrchUser.Text = ""; this.txtSrcContact.Text = ""; } catch (Exception e1) { } this.listType = 2; ContactService.PsnAPIService local = new ContactService.PsnAPIService(); local.Url = serviceUtil.getPpolURL() + "/cxf/PsnAPI"; ppolContacts = local.getContactsByList(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword(), contactListId); this.grdUsers.Rows.Clear(); if (ppolContacts != null) { for (int i = 0; i < ppolContacts.Length; i++) { ContactService.ppolContact contact = ppolContacts[i]; this.grdUsers.Rows.Add(); this.grdUsers.Rows[i].Cells[0].Value = false; this.grdUsers.Rows[i].Cells[1].Value = contact.displayName; this.grdUsers.Rows[i].Cells[2].Value = contact.primaryEmail; } } } catch (Exception ex) { ClassFactory.Instance.ConnectionProblem(ex); } }