示例#1
0
        // Display new form Open_Auctions
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.IsMdiContainer = true;

            Open_Auctions f = new Open_Auctions();

            f.MdiParent = this;
            f.Show();
        }
示例#2
0
        private void auctionButton_Click(object sender, EventArgs e)
        {
            if (ProdBuyerLV.SelectedItems.Count == 1)
            {
                ListViewItem item = ProdBuyerLV.SelectedItems[0];

                int productCode = Convert.ToInt32(item.SubItems[0].Text);

                Open_Auctions f = new Open_Auctions(productCode);
                f.Show();
            }

            else
            {
                MessageBox.Show("You need to select a product to access its auction.", "Error alert",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#3
0
        private void auctionbttn_Click(object sender, EventArgs e)
        {
            if (ProdSellerLV.SelectedItems.Count == 1)
            {
                ListViewItem item = ProdSellerLV.SelectedItems[0];

                int productCode = Convert.ToInt32(item.SubItems[0].Text);


                if (getStatus(productCode) == "Auction")
                {
                    Open_Auctions f = new Open_Auctions(productCode);
                    f.Show();
                }

                else if (getStatus(productCode) == "Sold")
                {
                    Closed_Auctions f = new Closed_Auctions(productCode);
                    f.Show();
                }


                else if (hasAuctionHistory(productCode))
                {
                    Closed_Auctions f = new Closed_Auctions(productCode);
                    f.Show();
                }

                else
                {
                    MessageBox.Show("This product does not have an auction history.", "Error alert",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }

            else
            {
                MessageBox.Show("You need to select a product to access its auction.", "Error alert",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }