Exemplo n.º 1
0
        private void CountBasketBook(BasketControl basketControl)
        {
            OleDbCommand command = new OleDbCommand("SELECT COUNT(*) FROM Basket", myConnection);

            myConnection.Open();
            basketControl.gunaLabel5.Text = "Итого: " + command.ExecuteScalar().ToString() + " книг";
            myConnection.Close();
        }
Exemplo n.º 2
0
        //------------------------------------------ Корзина
        private void btnBasket_Click(object sender, EventArgs e)
        {
            SearchPanel.Location = new Point(26, 11);
            btnBack.Visible      = false;
            _obj = this;

            if (InfoPanel.Controls.Count > 0)
            {
                InfoPanel.Controls.RemoveAt(0);
            }
            BasketControl basketControl = new BasketControl();

            InfoPanel.Controls.Add(basketControl);
            basketControl.Dock = DockStyle.Fill;
            basketControl.BringToFront();

            PrintBasketBook(basketControl);
            CountBasketBook(basketControl);
        }
Exemplo n.º 3
0
        private void PrintBasketBook(BasketControl basketControl)
        {
            OleDbCommand command = new OleDbCommand("SELECT * FROM Basket", myConnection);

            myConnection.Open();
            OleDbDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                ElBasketList Item = new ElBasketList();

                byte[]       Photo        = (byte[])(reader[2]);
                MemoryStream memoryStream = new MemoryStream(Photo);
                Item.gunaCirclePictureBox1.Image = Image.FromStream(memoryStream);
                Item.gunaLabel1.Text             = reader[1].ToString();
                Item.gunaLabel2.Text             = reader[3].ToString();
                basketControl.flowLayoutPanel1.Controls.Add(Item);
            }
            reader.Close();
            myConnection.Close();
        }