/// <summary> /// Loads the quote information on the page /// </summary> /// <param name="quoteID"></param> public void loadQuote(int quoteID) { oldQuote = QuoteViewModel.getQuote(quoteID); if (oldQuote != null) { // Customer details textBox_Customer.Text = oldQuote.customer.CustomerName; textBox_Contact_Details.Text = oldQuote.customer.PhoneNumber.ToString(); textBox_Email_Address.Text = oldQuote.customer.Email; textBox_Address.Text = oldQuote.customer.Address + ", " + oldQuote.customer.City + ", " + oldQuote.customer.Country; // Quote details textBox_idQuote.Text = oldQuote.idQuote.ToString(); quoteDate.SelectedDate = oldQuote.createdDate; issuedBy.Text = oldQuote.issuedBy; foreach (var p in oldQuote.products) { ProductDataGrid.Items.Add(p); } } else { MessageBox.Show("Quote id doesnt't exist"); } }
/// <summary> /// Loads the quote information on the page /// </summary> /// <param name="quoteID"></param> public void loadQuote(int quoteID) { quote = QuoteViewModel.getQuote(quoteID); if (quote != null) { // Customer details textBox_Customer.Text = quote.customer.CustomerName; textBox_Contact_Details.Text = quote.customer.PhoneNumber.ToString(); textBox_Email_Address.Text = quote.customer.Email; textBox_Address.Text = quote.customer.Address + ", " + quote.customer.City + ", " + quote.customer.Country; // Quote details txtBox_QuoteNumber.Text = quote.idQuote.ToString(); txtBox_QuoteNumber.IsReadOnly = true; txtBox_invoiceDate.Text = quote.createdDate.ToString("d"); txtBox_issuedBy.Text = quote.issuedBy; // Quote products quoteProductsGrid.ItemsSource = quote.products; } else { MessageBox.Show("Quote with ID = " + quoteID + ", does not exist"); } }