public AttachWorkerBase() { Properties.Settings settings = new Properties.Settings(); settings.Reload(); PPOLUrl = settings.PPOLURL; ppolAccount = settings.Account; userName = settings.UserName; password = settings.Password; bccAddressList = ""; toAddress = ""; ccEmails = ""; fromName = ""; /* * var binding = new System.ServiceModel.WSHttpBinding(); * var uri = new Uri(PPOLUrl + "/cxf/PsnNoteAPI"); * binding.Security.Mode = string.Equals(uri.Scheme, "https", StringComparison.OrdinalIgnoreCase) * ? System.ServiceModel.SecurityMode.Transport * : System.ServiceModel.SecurityMode.None; * apiClient = new PPOL.PPOLService.PsnNoteAPIClient(binding,new System.ServiceModel.EndpointAddress(uri));*/ apiClient = new Legacy.PPOLService2.PsnNoteAPIService(); apiClient.Url = PPOLUrl + "/cxf/PsnNoteAPI"; }
private void btnSearch_Click(object sender, EventArgs e) { // searchOpportunities(String companyName, String loginUN, String loginPW,String searchStr) try { Properties.Settings settings = new Properties.Settings(); settings.Reload(); String PPOLUrl = settings.PPOLURL; String ppolAccount = settings.Account; String userName = settings.UserName; String password = settings.Password; var local = new OppService.OppNoteAPIService(); local.Url = PPOLUrl + "/cxf/OppNoteAPI"; OppService.opportunityList oppList = local.searchOpportunities(ppolAccount, userName, password, this.txtOppName.Text); if (oppList.list == null) { if (oppList.errorMsg.Trim() != "") { MessageBox.Show(oppList.errorMsg); } else { if (this.txtOppName.Text.Trim() == "") { MessageBox.Show("Opportunities are not found in your PlanPlus Online account."); } else { MessageBox.Show("Opportunity name(s) containing '" + this.txtOppName.Text + "' are not found in your PlanPlus Online account."); } } } else { OppService.opportunity[] opp = oppList.list; this.grdOpp.Rows.Clear(); for (int i = 0; i < opp.Length; i++) { OppService.opportunity opportunity = opp[i]; string name = opportunity.oppName; string[] gridRow = new string[6]; gridRow[0] = opportunity.oppId.ToString(); gridRow[1] = opportunity.oppName; gridRow[2] = opportunity.oppDesc; gridRow[3] = opportunity.oppStatus; gridRow[4] = opportunity.oppStage; gridRow[5] = opportunity.oppAmount.ToString(); // gridRow[6] = this.grdOpp.Rows.Add(gridRow); // this.grdOpp.Rows[i].Cells[6].Value = true; } } } catch (Exception ex) { ClassFactory.Instance.ConnectionProblem(ex); } }
private void getContact() { try { Properties.Settings settings = new Properties.Settings(); settings.Reload(); String PPOLUrl = settings.PPOLURL; String ppolAccount = settings.Account; String userName = settings.UserName; String password = settings.Password; string fromName = ""; //MessageBox.Show("Inside the method"); using (var mItem = ClassFactory.Instance.Outlook.GetCurrentInspectorItem()) { if (mItem != null) { var senderEmailAddress = mItem.SenderEmailAddress; if (!string.IsNullOrEmpty(senderEmailAddress)) { fromName = senderEmailAddress; this.txtNewOpp.Text = mItem.Subject; senderName = mItem.SenderName; } } } /* * Microsoft.Office.Interop.Outlook.MailItem mItem = * (Microsoft.Office.Interop.Outlook.MailItem)Globals.ThisAddIn.Application.ActiveInspector().CurrentItem; * if (mItem.SenderEmailAddress != null && !mItem.SenderEmailAddress.Equals("")) * { * fromName = mItem.SenderEmailAddress; * this.txtNewOpp.Text = mItem.Subject; * senderName = mItem.SenderName; * }*/ var local = new Legacy.PPOLService.PsnNoteAPIService(); local.Url = PPOLUrl + "/cxf/PsnNoteAPI"; psn = local.findContactByEmail(ppolAccount, userName, password, fromName); MessageBox.Show("Called first API"); if (psn != null) { if (psn.errorMessage == "SUCCESS") { this.txtContactName.Text = psn.displayName; } else { if (psn.errorMessage.Trim().Contains("Account")) { MessageBox.Show(psn.errorMessage); this.Close(); } else { this.lblContactMsg.Text = "Contact was not found in PlanPlus Online. You can search and associate a contact, Otherwise system will create new contact."; } } } } catch (Exception ex) { ClassFactory.Instance.ConnectionProblem(ex); } }