示例#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();
        }
示例#2
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());
     }
 }
示例#3
0
        public XLTaskPane()
        {
            try
            {
                InitializeComponent();
                string str = XLDocument.ReadParameter("CRMid");
                docType = XLDocument.ReadParameter("DocType");

                client = XLMain.Client.FetchClient(str);
                //ClientIDLabel.Text = client.crmID;

                user  = XLMain.Staff.StaffFromUser(Environment.UserName);
                users = XLtools.StaffList(user, client, false, true);

                SenderDDL.DataSource    = users;
                SenderDDL.DisplayMember = "name";
                SenderDDL.ValueMember   = "crmID";
                SenderDDL.SelectedItem  = user;
                sender = user;
                XLDocument.UpdateParameter("Sender", sender.username);

                if (client != null)
                {
                    //set basic client info
                    string clientStr = client.clientcode + " - " + client.name;
                    ClientLbl.Text = clientStr;
                    SubjectTB.Text = client.name;
                    string fileStore = XLVirtualCabinet.FileStore(client.manager.office, client.department);
                    XLDocument.UpdateParameter("Cabinet", fileStore);
                    XLDocument.UpdateParameter("ClientStr", clientStr);

                    //Deal with salutations
                    if (client.salutations != null)
                    {
                        SalDDL.DataSource    = client.salutations;
                        SalDDL.DisplayMember = "Salutation";
                        SalDDL.ValueMember   = "Addressee";
                        sal = (XLMain.Salutation)SalDDL.SelectedItem;
                        if (sal != null)
                        {
                            AddresseeTB.Text  = sal.addressee;
                            SalutationTb.Text = sal.salutation;
                        }
                    }

                    //Add the appropriate header
                    XLDocument.Header clientHeader = XLDocument.MapHeader(client.office, client.department);


                    //Set up depending on whether it is insolvency or not
                    if (client.department == "INS")
                    {
                        //Deal with when calling ddl
                        WhencallingDDL.DataSource    = users;
                        WhencallingDDL.DisplayMember = "name";
                        WhencallingDDL.ValueMember   = "crmID";
                        WhenCallingCheck.Checked     = true;
                        SubjectTB.Text = XLInsol.GetSubject(client.crmID);
                    }
                    else
                    {
                        FAOBCheck.Checked        = true;
                        PandCCheck.Checked       = true;
                        WhenCallingCheck.Checked = false;
                    }

                    //Deal with addresses or fax no as appropriate
                    if (docType == "Letter")
                    {
                        if (client.addresses != null)
                        {
                            allAddresses               = client.addresses;
                            addressesDDL.DataSource    = allAddresses;
                            addressesDDL.DisplayMember = "address1";
                            addressesDDL.ValueMember   = "addressBlock";
                            add = (XLMain.Address)addressesDDL.SelectedItem;
                            if (add != null)
                            {
                                if (client.IsIndividual)
                                {
                                    addTB.Text = add.addressBlock;
                                }
                                else
                                {
                                    addTB.Text = client.name + Environment.NewLine + add.addressBlock;
                                }
                            }
                        }
                        if (clientHeader != null)
                        {
                            try
                            {
                                XLDocument.DeployHeader(clientHeader);
                            }
                            catch
                            {
                                MessageBox.Show("Unable to map header automatically." + Environment.NewLine + "Please run the Header/Footer menu.");
                            }
                        }
                    }
                    else if (docType == "Fax")
                    {
                        XLMain.Number fax = XLMain.Number.GetNumber(client.crmID, "Fax");
                        if (fax != null)
                        {
                            FaxTB.Text = fax.number;
                        }
                        if (clientHeader != null)
                        {
                            try
                            {
                                XLDocument.DeployHeader(clientHeader);
                            }
                            catch
                            {
                                MessageBox.Show("Unable to map header automatically." + Environment.NewLine + "Please run the Header/Footer menu.");
                            }
                        }
                    }

                    //set status
                    XLDocument.ChangeStatus("Draft");

                    //Alter fields dependant on doc type;
                    SetVisibility(docType);

                    if (client.department == "INS")
                    {
                        WhencallingDDL.Visible = true;
                        IPSContactBtn.Visible  = true;
                    }

                    //Update bookmarks dependant on doc type
                    UpdateBookmarks(docType);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to open taskpane");
                XLtools.LogException("TaskPane", ex.ToString());
            }
        }