예제 #1
0
        private void btmildavis_Click(object sender, EventArgs e)
        {
            MusicCDs tmp = new MusicCDs();

            dtmusic.CurrentCell = dtmusic.Rows[0].Cells[0];

            if (dtmusic.SelectedRows.Count == 0)
            {
                MessageBox.Show("Please Select Products !");
            }
            else
            {
                foreach (DataGridViewRow row in dtmusic.Rows)
                {
                    if (row.Selected == true)
                    {
                        tmp.ProductID = int.Parse(row.Cells[0].Value.ToString());
                        purchase      = new ItemToPurchase(tmp, 1);
                        shopping.AddProductToShoppingCart(purchase);
                    }
                }

                //dtlistshpcrd.DataSource = shopping.PrintShoppingCartProducts();
                lbltutar.Text = shopping.PaymentAmount().ToString() + "TL";
            }
        }
예제 #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            MusicCDs tmp = new MusicCDs();

            if (dtpurchased.SelectedRows.Count == 0)
            {
                MessageBox.Show("Please Select Products !");
            }
            else
            {
                foreach (DataGridViewRow row in dtpurchased.Rows)
                {
                    if (row.Selected == true)
                    {
                        tmp.ProductID = int.Parse(row.Cells[0].Value.ToString());
                        purchase      = new ItemToPurchase(tmp, 1);
                        shopping.RemoveProductToShoppingCart(purchase);
                    }
                }
            }

            dtpurchased.DataSource = shopping.PrintShoppingCartProducts();
            lbltutarpurchase.Text  = shopping.PaymentAmount().ToString() + "TL";
        }