Beispiel #1
0
 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 IPSContactBtn_Click(object sender, EventArgs e)
        {
            try
            {
                IPSContForm myForm = new IPSContForm(client);
                myForm.ShowDialog();
                XLInsol.Contact selectContact = myForm.selectedContact;
                if (selectContact != null)
                {
                    if (docType == "Letter")
                    {
                        if (selectContact != null)
                        {
                            allAddresses            = null;
                            addressesDDL.DataSource = null;
                            string add = selectContact.name;
                            add       += Environment.NewLine + selectContact.addressBlock;
                            addTB.Text = add;
                        }
                    }
                    else if (docType == "Fax")
                    {
                        if (selectContact.fax != null)
                        {
                            FaxTB.Text = selectContact.fax;
                        }
                    }
                    SalDDL.DataSource = null;
                    AddresseeTB.Text  = "";
                    SalutationTb.Text = "";

                    RevertBtn.Visible = true;
                    XLDocument.UpdateBookmark("Salutation", SalutationTb.Text);
                    XLDocument.UpdateBookmark("Addressee", AddresseeTB.Text);
                    XLDocument.UpdateBookmark("Addressee2", AddresseeTB.Text);
                    XLDocument.UpdateBookmark("Address", addTB.Text);
                    XLDocument.UpdateBookmark("Fax", FaxTB.Text);
                }
                else
                {
                    MessageBox.Show("No address returned");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to fetch insolvency contact");
                XLtools.LogException("InsolContactBtn", ex.ToString());
            }
        }