Ejemplo n.º 1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            if (clickCounter == 0 && ctrlShipping.Execute() == true)         // shipping type
            {
                button1.Visibility = Visibility.Visible;

                shipment = ctrlShipping.GetShipment();
                ctrlShipping.Visibility = Visibility.Hidden;
                clickCounter = 1;

                ctrlAddress.Visibility = Visibility.Visible;
            }
            else if (clickCounter == 1 && ctrlAddress.Execute() == true)    // address 
            {
                address = ctrlAddress.GetAddress();
                ctrlAddress.Visibility = Visibility.Hidden;
                clickCounter = 2;

                ctrlPayment.Visibility = Visibility.Visible;
                button.Content = "Buy";
            }
            else if (clickCounter == 2 && ctrlPayment.Execute() == true)    // payment
            {
                payment = ctrlPayment.GetPayment();
                Buy();
            }
 
        }
Ejemplo n.º 2
0
        public wndw_Product_Buy(DatabaseConnection conn, string username, List<Items> itemList, string sum, cartBox cB)
        {
            InitializeComponent();
            this.conn = conn;
            this.username = username;
            this.itemList = itemList;
            this.sum = sum;
            this.cB = cB;

            ctrlShipping.Init(conn);

            ctrlAddress.Visibility = Visibility.Hidden;
            ctrlPayment.Visibility = Visibility.Hidden;
            button1.Visibility = Visibility.Hidden;

            payment = null;
            address = null;
            shipment = null;

            clickCounter = 0;
        }