Esempio n. 1
0
        // LIST ALL AUCTIONS METHOD
        private void listAllAuctions()
        {
            ControlAuction ctrlAuction = new ControlAuction();
            List <Auction> allAuctions = ctrlAuction.GetAllAuctions();

            // CLEAR LIST
            listBoxAuctions.Items.Clear();

            // REFRESH LIST
            foreach (Auction auction in allAuctions)
            {
                listBoxAuctions.Items.Add(auction);
            }
        }
Esempio n. 2
0
        // METHOD - ASYNCHRONOUS FIND ALL AUCTIONS   (OBS. INVOKERS)
        private async Task ListAllAuctionsAsync()
        {
            await Task.Run(() => {
                ControlAuction ctrlAuction = new ControlAuction();
                List <Auction> allAuctions = ctrlAuction.GetAllAuctions();

                //Clear list
                this.Invoke((MethodInvoker)(() => listBoxAuctions.Items.Clear()));

                // Update list
                foreach (Auction auction in allAuctions)
                {
                    this.Invoke((MethodInvoker)(() => listBoxAuctions.Items.Add(auction)));
                }
            });
        }
        public List <Auction> GetAuctionAll()
        {
            ControlAuction ctrlAuction = new ControlAuction();

            return(ctrlAuction.GetAllAuctions());
        }