private void MyInvoicesMenu_OnClick(object sender, RoutedEventArgs e) { try { RestClient client = new RestClient( $"http://*****:*****@"There was an error in getting the mined invoices."); return; } var blocks = new JsonSerializer().Deserialize <List <Block> >(response); List <UiInvoice> invoices = (from block in blocks from invoice in block.data where invoice.publicKey == publicKey let inv = new UiInvoice(invoice) orderby inv.timestamp descending select inv) .ToList(); if (invoices.Count == 0) { ShowWarningMBox(@"You don't have any mined invoices. Please add an invoice, mine it, or wait for someone else to mine it. Then open this dialog."); } else { var window = new ViewInvoicesWindow(invoices) { Title = "My mined invoices" }; window.ShowDialog(); } } catch (Exception) { ShowErrorMBox(@"There was an error in parsing/showing the mined invoices"); } }
private void MyPendingInvoices_OnClick(object sender, RoutedEventArgs e) { try { RestClient client = new RestClient( $"http://*****:*****@"There was an error in getting the pending invoices."); return; } List <UiInvoice> invoices = (from invoice in new JsonSerializer().Deserialize <List <Invoice> >(response) where invoice.publicKey == publicKey let inv = new UiInvoice(invoice) orderby inv.timestamp descending select inv) .ToList(); if (invoices.Count == 0) { ShowWarningMBox(@"You don't have any pending invoices. This may mean that all your invoices are already been mined or that you didn't add any invoices at all."); } else { var window = new ViewInvoicesWindow(invoices) { Title = "My pending invoices" }; window.ShowDialog(); } } catch (Exception) { ShowErrorMBox(@"There was an error in parsing/showing the pending invoices"); } }