private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DeskQuoteView currentViewItem = (DeskQuoteView)this.dataGridView1.CurrentRow.DataBoundItem; DisplayQuote displayQuoteForm = new DisplayQuote(currentViewItem.Quote); displayQuoteForm.Show(); }
//This is the "show all" version public List <DeskQuoteView> getSearchResults() { List <DeskQuote> deskQuotes = new List <DeskQuote>(savedQuotesRepository.GetAll()); DeskQuoteView dqv; List <DeskQuoteView> searchResults = new List <DeskQuoteView>(); foreach (DeskQuote dq in deskQuotes) { dqv = new DeskQuoteView(dq); searchResults.Add(dqv); } SortQuotes(ref searchResults); return(searchResults); }
public List <DeskQuoteView> getSearchResults(string customerName) { List <DeskQuote> deskQuotes = new List <DeskQuote>(savedQuotesRepository.GetAll()); DeskQuoteView dqv; List <DeskQuoteView> searchResults = new List <DeskQuoteView>(); foreach (DeskQuote dq in deskQuotes) { //We will only add matching material types to the view. if (dq.CustomerName.ToUpper().Contains(customerName.ToUpper())) { dqv = new DeskQuoteView(dq); searchResults.Add(dqv); } } SortQuotes(ref searchResults); return(searchResults); }
// Called by event handler on dropdown to populate grid public List <DeskQuoteView> getSearchResults(DesktopMaterial desktopMaterial) { List <DeskQuote> deskQuotes = new List <DeskQuote>(savedQuotesRepository.GetAll()); DeskQuoteView dqv; List <DeskQuoteView> searchResults = new List <DeskQuoteView>(); foreach (DeskQuote dq in deskQuotes) { //We will only add matching material types to the view. if (dq.Desk.Material == desktopMaterial) { dqv = new DeskQuoteView(dq); searchResults.Add(dqv); } } SortQuotes(ref searchResults); return(searchResults); }