private void searchProductButton_Click(object sender, EventArgs e)
        {
            CheckProductForm checkProductForm = new CheckProductForm(conn, searchedProduct);

            checkProductForm.ShowDialog();
            if (checkProductForm.DialogResult == DialogResult.Yes)
            {
                string[] row = { Convert.ToString(searchedProduct.ProductId),
                                 searchedProduct.ProductName,
                                 Convert.ToString(searchedProduct.Price),
                                 Convert.ToString(1.0 - searchedProduct.PriceCut),
                                 Convert.ToString(searchedProduct.Quantity),
                                 searchedProduct.BarCode };
                itemsList.Items.Add(new ListViewItem(row));
                totalCost        += searchedProduct.Price * searchedProduct.PriceCut;
                totalCost         = Math.Round(totalCost, 2);
                totalCostBox.Text = "Cena łącznie: " + Convert.ToString(totalCost);
            }
        }
Beispiel #2
0
        // opens search dialog box, if product chosen sets boxes to it's data, if no product chosen then resets boxes
        private void searchButton_Click(object sender, EventArgs e)
        {
            CheckProductForm checkProductForm = new CheckProductForm(conn, product);

            checkProductForm.ShowDialog();
            if (checkProductForm.DialogResult == DialogResult.Yes)
            {
                nameBox.Text     = product.ProductName;
                priceBox.Text    = Convert.ToString(product.Price);
                pricecutBox.Text = Convert.ToString(1.0 - product.PriceCut);
                quantityBox.Text = Convert.ToString(product.Quantity);
                barcodeBox.Text  = product.BarCode;
                checkDataCorrectness();
                infoBox.Text = "Znaleziono produkt!";
            }
            else
            {
                reset();
                infoBox.Text = "Przerwano wyszukiwanie!";
            }
        }
        private void searchProductButton_Click(object sender, EventArgs e)
        {
            CheckProductForm checkProductForm = new CheckProductForm(conn, searchedProduct);

            checkProductForm.ShowDialog();
            if (checkProductForm.DialogResult == DialogResult.Yes)
            {
                string[] row = { Convert.ToString(searchedProduct.ProductId),
                                 searchedProduct.ProductName,
                                 Convert.ToString(searchedProduct.Price),
                                 Convert.ToString(1.0 - searchedProduct.PriceCut),
                                 Convert.ToString(searchedProduct.Quantity),
                                 searchedProduct.BarCode,
                                 "1" };
                if (!ItemAlreadyOnList(row[0]))
                {
                    itemsList.Items.Add(new ListViewItem(row));
                }
                else
                {
                    infoBox.Text = "Przedmiot znajduje się już na liście!";
                }
            }
        }
Beispiel #4
0
        private void checkProductButton_Click(object sender, EventArgs e)
        {
            CheckProductForm checkProductForm = new CheckProductForm(conn);

            checkProductForm.ShowDialog();
        }