private void InsolAddressBtn_Click(object sender, RibbonControlEventArgs e) { try { ClientForm myClientForm = new ClientForm(); myClientForm.ShowDialog(); XLMain.Client client = myClientForm.selectedClient; IPSContForm myForm = new IPSContForm(client); myForm.ShowDialog(); XLInsol.Contact selectContact = myForm.selectedContact; if (selectContact != null) { string str = selectContact.name + Environment.NewLine; str += selectContact.addressBlock; XLDocument.InsertText(str); //XLDocument.AddStatusBox(); //XLDocument.ChangeStatus("Draft"); } else { MessageBox.Show("No contact selected."); } } catch (Exception ex) { MessageBox.Show("Unable to get insolvency address"); XLtools.LogException("InsolAddressBtn", ex.ToString()); } }
private void LaunchClientDoc(string docType) { try { ClientForm myForm = new ClientForm(); myForm.ShowDialog(); XLMain.Client selectedClient = myForm.selectedClient; if (selectedClient != null) { string crmId = selectedClient.crmID; XLDocument.openTemplate(docType); XLDocument.UpdateParameter("CRMid", crmId); XLDocument.UpdateParameter("DocType", docType); //this appears to work in 3.5 notwithstanding the reference to Globals xlTaskPane1 = new XLTaskPane(); CustomxlTaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(xlTaskPane1, "XLant Document Handler", Globals.ThisAddIn.Application.ActiveWindow); CustomxlTaskPane.Visible = true; CustomxlTaskPane.Width = 350; } } catch (Exception e) { MessageBox.Show("Unable to launch document"); XLtools.LogException("LaunchClientDoc", docType + " - " + e.ToString()); } }
private void IndexBtn_Click(object sender, RibbonControlEventArgs e) { try { XLDocument.currentDoc.Save(); //populate description string desc = XLDocument.ReadParameter("DocType"); desc += " to "; desc += XLDocument.ReadBookmark("Addressee"); string str = XLDocument.ReadParameter("CRMid"); XLMain.Client client = new XLMain.Client(); if (str != "") { client = XLMain.Client.FetchClient(str); } else { ClientForm cForm = new ClientForm(); cForm.ShowDialog(); client = cForm.selectedClient; } XLMain.Staff writer = new XLMain.Staff(); string writerID = XLDocument.ReadParameter("Sender"); if (writerID == "") { writer = XLMain.Staff.StaffFromUser(Environment.UserName); } else { writer = XLMain.Staff.StaffFromUser(XLDocument.ReadParameter("Sender")); } VCForm myForm = new VCForm(writer, client, XLDocument.currentDoc.FullName, desc, XLDocument.ReadParameter("VCStatus")); myForm.ShowDialog(); //collect result from form XLVirtualCabinet.BondResult outcome = myForm.outcome; if (outcome.ExitCode == 0) { XLDocument.EndDocument(); xlTaskPane1.Dispose(); } else { MessageBox.Show("Unable to index document, please index manually. Error code: " + outcome.ExitCode.ToString() + "-" + outcome.StandardOutput.ToString()); } //close the dialog in any event. } catch (Exception ex) { MessageBox.Show("Error calling the VC integration. Error code: " + ex.ToString()); XLtools.LogException("IndexBtn", ex.ToString()); } }
private void BioBtn_Click(object sender, RibbonControlEventArgs e) { XLForms.ClientForm selectForm = new ClientForm(); selectForm.ShowDialog(); XLMain.Client client = selectForm.selectedClient; MergeClient bioClient = new MergeClient(client); XLDocument.UpdateCurrentDoc(); Range range = XLDocument.currentDoc.Range(); XLDocument.UpdateFieldsFromRange(range, bioClient); }
private void ClientAddressBtn_Click(object sender, RibbonControlEventArgs e) { try { ClientForm myForm = new ClientForm(); myForm.ShowDialog(); XLMain.Client client = myForm.selectedClient; //Add the name and address at the cursor location string str = ""; if (client.addresses.Count > 0) { if (client.salutations.Count > 0) { str += client.salutations[0].addressee + Environment.NewLine; if (client.name != client.salutations[0].addressee) { str += client.name + Environment.NewLine; } } else { str += client.name + Environment.NewLine; } str += client.addresses[0].addressBlock; XLDocument.InsertText(str); //Add any parameters we can for later indexing string fileStore = XLVirtualCabinet.FileStore(client.office, client.department); XLDocument.UpdateParameter("CRMid", client.crmID); XLDocument.UpdateParameter("Cabinet", fileStore); XLDocument.UpdateParameter("ClientStr", client.clientcode + " - " + client.name); //insert the status text box; //XLDocument.AddStatusBox(); //XLDocument.ChangeStatus("Draft"); } else { MessageBox.Show(client.name + " does not have an address in the system."); } } catch (Exception ex) { MessageBox.Show("Unable to client address"); XLtools.LogException("ClientAddressBtn", ex.ToString()); } }