示例#1
0
        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());
            }
        }
示例#2
0
        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);
        }
示例#3
0
 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());
     }
 }