コード例 #1
0
        private void NewReceipt(AccountKey extendedKey)
        {
            try
            {
                int?addressIndex            = 0;
                ReceiptKeyWindow newReceipt = new ReceiptKeyWindow(tcBitcoin.NewChangeKey(extendedKey.KeyName, extendedKey.HDPath, CoinChangeType.Receipt, ref addressIndex));
                newReceipt.KeyNamespace = extendedKey.KeyNamespace;

                if (newReceipt.ShowDialog() == true)
                {
                    if (tcBitcoin.AddReceiptKey(extendedKey.KeyName, newReceipt.PaymentAddress, (int)addressIndex, newReceipt.Note))
                    {
                        if (tabAccountDetails.SelectedItem != pageReceiptKeys)
                        {
                            tabAccountDetails.SelectedItem = pageReceiptKeys;
                        }
                        else
                        {
                            RefreshReceiptKeys();
                        }
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show($"{err.Message}", $"{err.Source}.{err.TargetSite.Name}", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
コード例 #2
0
        private void MenuItemNote_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                fnChangeResult   change           = (fnChangeResult)dgChange.SelectedItem;
                ReceiptKeyWindow receiptKeyWindow = new ReceiptKeyWindow(change.PaymentAddress, change.InvoiceNumber == null ? string.Empty : change.InvoiceNumber);
                receiptKeyWindow.KeyNamespace = change.KeyNamespace;
                receiptKeyWindow.Note         = change?.Note;

                if (receiptKeyWindow.ShowDialog() == true)
                {
                    if (tcBitcoin.ChangeKeyNote(change.PaymentAddress, receiptKeyWindow.Note))
                    {
                        Refresh();
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show($"{err.Message}", $"{err.Source}.{err.TargetSite.Name}", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
コード例 #3
0
        private void MenuItemNewReceipt_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var invoice = (vwInvoicedReceipts)dgInvoices.SelectedItem;

                int?addressIndex = 0;

                ReceiptKeyWindow newReceipt = new ReceiptKeyWindow(tcBitcoin.NewChangeKey(AccountKey.KeyName, AccountKey.HDPath, CoinChangeType.Receipt, ref addressIndex), invoice.InvoiceNumber);
                newReceipt.KeyNamespace = AccountKey.KeyNamespace;

                if (newReceipt.ShowDialog() == true)
                {
                    if (tcBitcoin.AddChangeKey(AccountKey.KeyName, CoinChangeType.Receipt, newReceipt.PaymentAddress, (int)addressIndex, newReceipt.Note, newReceipt.InvoiceNumber))
                    {
                        Refresh();
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show($"{err.Message}", $"{err.Source}.{err.TargetSite.Name}", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }