private void DebitAccountCombo()
 {
     foreach (var account in accountVM.AccountList())
     {
         ComboBoxItem item = new ComboBoxItem();
         item.Name    = account.id.ToString();
         item.Content = account.name.ToString();
         DebitComboBox.Items.Add(item);
     }
 }
 private void LoadAccountReceivableIdCombo()
 {
     foreach (var account in accountVM.AccountList())
     {
         ComboBoxItem item = new ComboBoxItem();
         item.Name    = account.id.ToString();
         item.Content = account.name.ToString();
         if (composite["AccountReceivableId"] != null && composite["AccountReceivableId"].ToString() != "-1" &&
             composite["AccountReceivableId"].ToString() == account.id.ToString())
         {
             item.IsSelected = true;
         }
         AccountReceivableIdComboBox.Items.Add(item);
     }
 }
Пример #3
0
 private void LoadParentCombo()
 {
     foreach (var account in viewModel.AccountList())
     {
         ComboBoxItem item = new ComboBoxItem();
         item.Name    = account.id.ToString();
         item.Content = account.name.ToString();
         ParentComboBox.Items.Add(item);
     }
 }
Пример #4
0
        private void LoadAccountGrid()
        {
            Windows.Storage.ApplicationDataCompositeValue composite = settings.GetSettingsComposite();
            int length = int.Parse(composite["NumberOfAccountInJournal"].ToString());

            for (int counter = 0; counter < length; counter++)
            {
                StackPanel stackpanel = new StackPanel();
                stackpanel.Name        = "StackPanel" + counter.ToString();
                stackpanel.Orientation = Orientation.Horizontal;
                stackpanel.Margin      = new Thickness(5, 0, 0, 0);

                ComboBox AccountComboBox = new ComboBox();
                AccountComboBox.Name  = "ComboBox" + counter.ToString();
                AccountComboBox.Width = 100;
                foreach (var account in accountVM.AccountList())
                {
                    ComboBoxItem item = new ComboBoxItem();
                    item.Name    = account.id.ToString();
                    item.Content = account.name.ToString();
                    AccountComboBox.Items.Add(item);
                }
                stackpanel.Children.Add(AccountComboBox);

                TextBox DebitTextBox = new TextBox();
                DebitTextBox.Name            = "DebitTextBox" + counter.ToString();
                DebitTextBox.PlaceholderText = "Debit";
                DebitTextBox.FontSize        = 18;
                DebitTextBox.Width           = 100;
                DebitTextBox.Margin          = new Thickness(5, 0, 0, 0);
                stackpanel.Children.Add(DebitTextBox);

                TextBox CreditTextBox = new TextBox();
                CreditTextBox.Name            = "CreditTextBox" + counter.ToString();
                CreditTextBox.PlaceholderText = "Credit";
                CreditTextBox.FontSize        = 18;
                CreditTextBox.Width           = 100;
                CreditTextBox.Margin          = new Thickness(5, 0, 0, 0);
                stackpanel.Children.Add(CreditTextBox);

                AccountInfoStackPanel.Children.Add(stackpanel);
            }
        }