private void DisplayInvoice() { if (CurrentSelectedInvoice != null) { InvoiceTxtbox.Text = CurrentSelectedInvoice.InvoiceID.ToString(); v.Text = CurrentSelectedInvoice.InvoiceDateTime.ToString(); CustNameTxbox.Text = CurrentSelectedInvoice.CustomerName; CustEmailTxtbox.Text = CurrentSelectedInvoice.CustomerEmail; CustAddressTxbox.Text = CurrentSelectedInvoice.CustomerAddress; //if items are shipped, checkbox is checked if ((bool)CurrentSelectedInvoice.Shipping == true) { ShippedChckbox.IsChecked = true; } else { ShippedChckbox.IsChecked = false; } } else { InvoiceTxtbox.Clear(); CustNameTxbox.Clear(); CustEmailTxtbox.Clear(); CustAddressTxbox.Clear(); } }
private void NewBtn_Click(object sender, RoutedEventArgs e) { InvoiceTxtbox.Clear(); CustNameTxbox.Clear(); CustEmailTxtbox.Clear(); CustAddressTxbox.Clear(); isNewRecord = true; }
private void NewBtn_Click(object sender, RoutedEventArgs e) { //to clear all textbox and be ready to save InvoiceTxtbox.Clear(); CustNameTxbox.Clear(); CustEmailTxtbox.Clear(); CustAddressTxbox.Clear(); MessageTextBox.Clear(); isNewRecord = true; }