Exemplo n.º 1
0
        private void IndexBtn_Click(object sender, EventArgs e)
        {
            string fullPath  = docPath;
            string cabinet   = XLVirtualCabinet.FileStore(client.manager.office, client.department);
            string clientStr = client.clientcode + " - " + client.name;

            XLMain.Staff toBe    = (XLMain.Staff)ToBeActionDDL.SelectedItem;
            string       desc    = DescTB.Text;
            string       section = "";

            if (client.department != "INS")
            {
                section = "Correspondence";
            }
            else
            {
                section = FileSectionDDL.SelectedItem.ToString();
            }
            //Launch the index process and collect the result
            XLVirtualCabinet.BondResult outcome = XLVirtualCabinet.IndexDocument(fullPath, cabinet, clientStr, status, toBe.name, section, desc);

            if (outcome.ExitCode == 0)
            {
                XLDocument.EndDocument();
            }
            else
            {
                MessageBox.Show("Unable to index document, please index manually.  Error code: " + outcome.ExitCode.ToString() + "-" + outcome.StandardOutput.ToString());
            }
            //close the dialog in any event.
            this.Close();
        }
Exemplo n.º 2
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());
            }
        }
Exemplo n.º 3
0
        public static void IndexPDFCopy(string filestring, string origFileID)
        {
            try
            {
                //get the info of the original file
                XLVirtualCabinet.FileInfo   fileInfo = XLVirtualCabinet.FileIndex(origFileID);
                XLVirtualCabinet.BondResult result   = XLVirtualCabinet.IndexDocument(filestring, fileInfo);

                if (result.ExitCode != 0)
                {
                    MessageBox.Show("Unable to index pdf, please index manually.  Error code: " + result.ExitCode.ToString() + "-" + result.StandardOutput.ToString());
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("Unable to index pdf document" + filestring);
                XLtools.LogException("IndexPDFCopy", e.ToString());
            }
        }
Exemplo n.º 4
0
        private void ApproveBtn_Click(object sender, RibbonControlEventArgs e)
        {
            try
            {
                Microsoft.Office.Interop.Word._Application app = Globals.ThisAddIn.Application;

                XLDocument.ChangeStatus("Approved");
                XLMain.Client client = null;
                string        fileID = XLDocument.GetFileID();
                if (String.IsNullOrEmpty(fileID))
                {
                    return;
                }

                if (XLDocument.ReadParameter("CRMid") != null)
                {
                    client = XLMain.Client.FetchClient(XLDocument.ReadParameter("CRMid"));
                }
                else
                {
                    //if the document param doesn't exist get the index data from VC
                    client = XLVirtualCabinet.GetClientFromIndex(fileID);
                }
                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"));
                }
                StaffSelectForm myForm = new XLForms.StaffSelectForm(client, writer);
                myForm.ShowDialog();
                XLMain.EntityCouplet staff = myForm.selectedStaff;

                if (myForm.DialogResult == DialogResult.OK)
                {
                    if (staff == null)
                    {
                        //make blank if no staff selected
                        staff.name = "";
                    }
                    string commandfileloc = "";
                    if (XLDocument.ReadBookmark("Date") == "")
                    {
                        commandfileloc = XLVirtualCabinet.Reindex(fileID, staff.name, XLDocument.ReadParameter("VCStatus"));
                    }
                    else
                    {
                        string docDate = XLDocument.ReadBookmark("Date");
                        commandfileloc = XLVirtualCabinet.Reindex(fileID, staff.name, XLDocument.ReadParameter("VCStatus"), docDate);
                    }
                    XLVirtualCabinet.BondResult result = XLVirtualCabinet.LaunchCabi(commandfileloc, true);
                    if (result.ExitCode != 0)
                    {
                        MessageBox.Show("Reindex failed please complete manually");
                    }
                    else
                    {
                        app.ActiveDocument.Save();
                        app.ActiveWindow.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to approve document");
                XLtools.LogException("ApproveBtn", ex.ToString());
            }
        }
Exemplo n.º 5
0
        private void ForwardBtn_Click(object sender, RibbonControlEventArgs e)
        {
            try
            {
                XLMain.Client client = null;
                string        fileID = XLDocument.GetFileID();
                if (String.IsNullOrEmpty(fileID))
                {
                    return;
                }

                if (XLDocument.ReadParameter("CRMid") != null)
                {
                    client = XLMain.Client.FetchClient(XLDocument.ReadParameter("CRMid"));
                }
                else
                {
                    //if the document param doesn't exist get the index data from VC
                    client = XLVirtualCabinet.GetClientFromIndex(fileID);
                }

                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"));
                }
                StaffSelectForm myForm = new StaffSelectForm(client, writer);
                myForm.ShowDialog();
                XLMain.EntityCouplet staff = myForm.selectedStaff;

                string commandfileloc = "";
                if (XLDocument.ReadBookmark("Date") == "")
                {
                    commandfileloc = XLVirtualCabinet.Reindex(XLDocument.GetFileID(), staff.name);
                }
                else
                {
                    string docDate = XLDocument.ReadBookmark("Date");
                    commandfileloc = XLVirtualCabinet.Reindex(XLDocument.GetFileID(), staff.name, docDate: docDate);
                }

                //MessageBox.Show(commandfileloc);
                XLVirtualCabinet.BondResult result = XLVirtualCabinet.LaunchCabi(commandfileloc, true);
                if (result.ExitCode != 0)
                {
                    MessageBox.Show("Reindex failed please complete manually.");
                }
                else
                {
                    XLDocument.EndDocument();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to forward document");
                XLtools.LogException("ForwardBtn", ex.ToString());
            }
        }