예제 #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            pbBicycle.Show();
            pbCap.Show();
            pbCharger.Show();
            pbCamera.Show();

            dataHelper = new Mysql();

            lbCameraPrice.Text  = dataHelper.GetPrdouctPrice("Camera").ToString() + "€";
            lbBicyclePrice.Text = dataHelper.GetPrdouctPrice("Bicycle").ToString() + "€";
            lbChargerPrice.Text = dataHelper.GetPrdouctPrice("Charger").ToString() + "€";
            lbGogglesPrice.Text = dataHelper.GetPrdouctPrice("Googgles").ToString() + "€";

            lbCameraPrice.Show();
            lbBicyclePrice.Show();
            lbChargerPrice.Show();
            lbGogglesPrice.Show();

            bicycle_quantity = dataHelper.GetStockQuantityOfBicycle();
            camera_quantity  = dataHelper.GetStockQuantityOfCamera();
            googles_quantiy  = dataHelper.GetStockQuantityOfGooggles();
            charger_quantity = dataHelper.GetStockQuantityOfCharger();


            if (bicycle_quantity < 1)
            {
                lbBicycleQuantity.Text = " Currently out of the stock";
                bicycle_quantity       = 0;
            }
            else
            {
                lbchargrQuan.Text = bicycle_quantity + "LEFT";
            }

            if (camera_quantity < 1)
            {
                lbCameraQuantity.Text = " Currently out od the stock";
                camera_quantity       = 0;
            }
            else
            {
                lbCameraQuantity.Text = camera_quantity + " LEFT";
            }

            if (googles_quantiy < 1)
            {
                lbGogglesQuantity.Text = " Currently out of the stock";
                googles_quantiy        = 0;
            }
            else
            {
                lbGogglesQuantity.Text = googles_quantiy + " LEFT";
            }

            if (charger_quantity < 1)
            {
                lbchargrQuan.Text = " Currently out of the stock";
                charger_quantity  = 0;
            }
            else
            {
                lbBicycleQuantity.Text = charger_quantity + " LEFT";
            }
            timer.Stop();
        }