Example #1
0
        private void LogOutButton_Click(object sender, RoutedEventArgs e)
        {
            mw.login_logout_StackPanel.Children.Clear();
            loginHeaderBox lHB = new loginHeaderBox(mw, dbConn);
            mw.login_logout_StackPanel.Children.Add(lHB);

            mw.cartInfoBox.Children.Clear();
            mw.loginTmp = 0;
            mw.hideUnhideAddButton(1);

            mw.addNewsButton.Visibility = Visibility.Hidden;
            mw.testButton2.Visibility = Visibility.Hidden;
            mw.testButton3.Visibility = Visibility.Hidden;

            mw.hideUnhideAdminButton(1);
            mw.startPageButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            dbConn = new DatabaseConnection("46.109.120.29", "3306", "shop", "csharp", "FSzWUcCcm8fAsdJe");

            drawNews();
            startPageButton.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent));
            ReadData();

            iI = new itemInformation(this, productList);

            stackPanelList.Add(sp1);
            stackPanelList.Add(sp2);
            stackPanelList.Add(sp3);
            stackPanelList.Add(sp4);
            stackPanelList.Add(sp5);
            stackPanelList.Add(sp6);
            stackPanelList.Add(sp7);
            stackPanelList.Add(sp8);
            stackPanelList.Add(sp9);
            stackPanelList.Add(sp10);

            // Login Register
            loginHeaderBox lHB = new loginHeaderBox(this, dbConn);
            login_logout_StackPanel.Children.Add(lHB);

            labelSort1.Visibility = Visibility.Hidden;
            labelSort2.Visibility = Visibility.Hidden;
            labelSort3.Visibility = Visibility.Hidden;
            labelSort4.Visibility = Visibility.Hidden;
            labelSort5.Visibility = Visibility.Hidden;
            button.Visibility = Visibility.Hidden;
            button1.Visibility = Visibility.Hidden;
            button2.Visibility = Visibility.Hidden;
            button3.Visibility = Visibility.Hidden;
            button4.Visibility = Visibility.Hidden;
            button5.Visibility = Visibility.Hidden;
            button6.Visibility = Visibility.Hidden;
            textBox.Visibility = Visibility.Hidden;
        }