예제 #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 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);
            }
        }