Esempio n. 1
0
        public SelectStaffForm(XLMain.Client client, XLMain.Staff sender, List <XLMain.EntityCouplet> staffList = null)
        {
            InitializeComponent();
            this.CenterToParent();

            //populate the sender
            List <XLMain.EntityCouplet> users = new List <XLMain.EntityCouplet>();

            users = XLtools.StaffList(sender, client, true, userList: staffList);

            SelectDDL.DataSource    = users;
            SelectDDL.DisplayMember = "name";
            SelectDDL.ValueMember   = "crmID";
            if (sender != null)
            {
                SelectDDL.SelectedItem = sender.crmID;
            }
        }
Esempio n. 2
0
        private void IndexBtn_Click(object sender, EventArgs e)
        {
            string folder   = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\XLant\\temp\\";
            string tempPath = folder + "temp.msg";

            email.SaveAs(tempPath);

            string cabinet   = XLVirtualCabinet.FileStore(client.office, client.department);
            string clientStr = client.clientcode + " - " + client.name;
            string status    = "";

            if (email.ReceivedTime != null)
            {
                status = "External";
            }
            else if (email.SentOn != null)
            {
                status = "Sent";
            }
            else
            {
                status = "Draft";
            }
            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(tempPath, cabinet, clientStr, status, toBe.name, section, desc);

            //close the dialog in any event.
            this.Close();
        }
Esempio n. 3
0
        public DescForm(string senderUsername = "", string tempDesc = "")
        {
            InitializeComponent();
            this.CenterToParent();
            DescTB.Text = tempDesc;

            XLMain.Staff user = XLMain.Staff.StaffFromUser(senderUsername);
            //populate the ddl
            List <XLMain.Staff> users = new List <XLMain.Staff>();

            users = XLMain.Staff.AllStaff();
            //place the sender at the top of the list
            if (user != null)
            {
                users.Insert(0, user);
            }
            SenderDDL.DataSource    = users;
            SenderDDL.DisplayMember = "name";
            SenderDDL.ValueMember   = "crmID";
            SenderDDL.SelectedItem  = user;
        }
Esempio n. 4
0
        public VCForm(XLMain.Client recClient, MailItem recEmail)
        {
            InitializeComponent();
            client = recClient;
            email  = recEmail;

            //Get the information you can
            //Collect data for filing
            string desc = email.SenderName + "re:" + email.Subject;

            DescTB.Text = desc;

            //populate To Be Actioned by
            XLMain.Staff staff = new XLMain.Staff();
            staff = XLMain.Staff.StaffFromUser(Environment.UserName);

            //populate the sender
            List <XLMain.Staff> users = new List <XLMain.Staff>();

            users = XLMain.Staff.AllStaff();
            int i = 0;

            //place current and connected users at the top of the list, could remove them elsewhere but seems no point
            if (staff != null)
            {
                users.Insert(i, staff);
                i += 1;
            }
            if (client.partner != null)
            {
                users.Insert(i, client.partner);
                i += 1;
            }
            if (client.manager != null)
            {
                users.Insert(i, client.manager);
                i += 1;
            }
            //add a blank in case there is no further action required
            users.Insert(i, new XLMain.Staff());

            //users.Insert(3, client.other);  Other not yet part of client
            ToBeActionDDL.DataSource    = users;
            ToBeActionDDL.DisplayMember = "name";
            ToBeActionDDL.ValueMember   = "crmID";
            if (staff != null)
            {
                ToBeActionDDL.SelectedItem = staff;
            }

            if (client.department != "INS")
            {
                FileSectionDDL.Visible = false;
                FileSectionlbl.Visible = false;
            }
            else
            {
                FileSectionDDL.Visible = true;
                FileSectionlbl.Visible = true;
            }
        }
Esempio n. 5
0
        public static void IndexAttachments(Outlook.MailItem email)
        {
            if (email.Attachments.Count > 0)
            {
                XLVirtualCabinet.BondResult outcome = new XLVirtualCabinet.BondResult();
                string fileid  = "";
                string docPath = "";
                XLVirtualCabinet.FileInfo info = new XLVirtualCabinet.FileInfo();
                for (int i = 1; i <= email.Attachments.Count; i++)
                {
                    string folder = XLtools.TempPath();
                    if (i == 1)
                    {
                        email.Attachments[i].SaveAsFile(folder + email.Attachments[i].FileName);
                        XLMain.Client selectClient = GetClient(email);
                        //Collect data for indexing
                        XLMain.Staff user = XLMain.Staff.StaffFromUser(Environment.UserName);
                        docPath = folder + email.Attachments[i].FileName;
                        string docDate = DateTime.Now.ToString("dd/MM/yyyy");
                        string status  = "External";
                        string desc    = email.Attachments[i].FileName;
                        if (XLantRibbon.staff.Count == 0)
                        {
                            XLantRibbon.staff = XLMain.Staff.AllStaff();
                        }
                        VCForm indexForm = new VCForm(user, selectClient, docPath, desc, status, docDate, "blank", XLantRibbon.staff);
                        indexForm.ShowDialog();
                        //collect result from form
                        outcome = indexForm.outcome;

                        //get the details of the file.
                        fileid = Regex.Match(outcome.StandardOutput, @"\d+").ToString();
                        info   = XLVirtualCabinet.FileIndex(fileid);

                        //add client to recent list
                        AddClienttoRecent(selectClient);
                    }
                    else
                    {
                        //save the next file
                        email.Attachments[i].SaveAsFile(folder + email.Attachments[i].FileName);
                        docPath = folder + email.Attachments[i].FileName;

                        foreach (XLVirtualCabinet.IndexPair pair in info.Indexes)
                        {
                            if (pair.index.ToUpper() == "INDEX03")
                            {
                                string d = email.Attachments[i].FileName;
                                //generate form for the description to be altered
                                SingleDataCaptureForm myForm = new SingleDataCaptureForm("Input Description", "Enter Description", d);
                                myForm.ShowDialog();
                                if (myForm.result == DialogResult.Cancel)
                                {
                                    continue;
                                }
                                else
                                {
                                    pair.value = myForm.data;
                                }
                            }
                        }
                        outcome = XLVirtualCabinet.IndexDocument(docPath, info);
                    }
                }
                MessageBox.Show("All Attachments Saved");
            }
        }
Esempio n. 6
0
 private void ContactListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     XLMain.EntityCouplet selectedItem = (XLMain.EntityCouplet)ContactListBox.SelectedItem;
     selectedContact = XLMain.Staff.FetchStaff(selectedItem.crmID);
     this.Close();
 }