コード例 #1
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            DeskQuoteView currentViewItem  = (DeskQuoteView)this.dataGridView1.CurrentRow.DataBoundItem;
            DisplayQuote  displayQuoteForm = new DisplayQuote(currentViewItem.Quote);

            displayQuoteForm.Show();
        }
コード例 #2
0
        //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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        // 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);
        }