Exemple #1
0
        private void cmbExternType_EditValueChanged(object sender, RoutedEventArgs e)
        {
            Type type;
            var  item = sender as BarEditItem;

            if (item != null)
            {
                var name = item.EditValue;
                externType = name.ToString();
                properties.Clear();
                if (name.ToString() == "Debtor")
                {
                    type = typeof(DebtorClient);
                }
                else
                {
                    type = typeof(DebtorInvoiceClient);
                }

                foreach (var field in UtilFunctions.GetAllDisplayPropertyNames(type, api.CompanyEntity, false, false))
                {
                    properties.Add(field);
                }
            }
        }
 public TextInHtmlPage(string html) : base(null)
 {
     // XtraRichEditLocalizer.Active = new UnicontaRichEditLocalizer();
     // XpfRichEditLocalizer.Active = new UnicontaXPfRichEditLocalizer();
     InitializeComponent();
     MainControl             = txtHtmlControl;
     txtHtmlControl.Loaded  += TxtHtmlControl_Loaded;
     txtHtmlControl.HtmlText = html;
     externTypes             = new ObservableCollection <string> {
         "Debtor", "DebtorInvoice", "Creditor", "CreditorInvoice", "Employee", "Contact"
     };
     properties       = new ObservableCollection <string>(UtilFunctions.GetAllDisplayPropertyNames(typeof(DebtorClient), api.CompanyEntity, false, false));
     this.DataContext = this;
 }
        private void cmbExternType_SelectedIndexChanged(object sender, RoutedEventArgs e)
        {
            Type type;

            switch (cmbExternType.SelectedIndex)
            {
            case 0:
                type = typeof(DebtorClient);
                break;

            case 1:
                type = typeof(DebtorInvoiceClient);
                break;

            case 2:
                type = typeof(CreditorClient);
                break;

            case 3:
                type = typeof(CreditorInvoiceClient);
                break;

            case 4:
                type = typeof(EmployeeClient);
                break;

            case 5:
                type = typeof(ContactClient);
                break;

            case 6:
                type = typeof(CrmCampaignMemberClient);
                break;

            case 7:
                type = typeof(CrmProspectClient);
                break;

            default: return;
            }

            type = api?.CompanyEntity.GetUserTypeNotNull(type);
            if (type != null)
            {
                cmbProperties.ItemsSource   = UtilFunctions.GetAllDisplayPropertyNames(type, api.CompanyEntity, false, false);
                cmbProperties.SelectedIndex = 0;
            }
        }
        private void cmbExternType_SelectedIndexChanged(object sender, RoutedEventArgs e)
        {
            Type type;
            var  comp = api?.CompanyEntity;

            if (cmbExternType.SelectedIndex == 0)
            {
                type = comp?.GetUserType(typeof(DebtorClient)) ?? typeof(DebtorClient);
            }
            else
            {
                type = comp?.GetUserType(typeof(DebtorInvoiceClient)) ?? typeof(DebtorInvoiceClient);
            }

            List <string> propertyNames = UtilFunctions.GetAllDisplayPropertyNames(type, api.CompanyEntity, false, false);

            cmbProperties.ItemsSource   = propertyNames;
            cmbProperties.SelectedIndex = 0;
        }