Esempio n. 1
0
        public MainWindow(string acc_no, DateTime timeIn)
        {
            InitializeComponent();
            accNo       = acc_no;
            this.timeIn = timeIn;
            usc_dashboard usd = new usc_dashboard();

            GridMain.Children.Add(usd);
        }
Esempio n. 2
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UserControl usc = null;

            GridMain.Children.Clear();

            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "dashboardHome":
                usc = new usc_dashboard();
                GridMain.Children.Add(usc);
                break;

            case "manageUsers":
                usc = new usc_accounts();
                GridMain.Children.Add(usc);
                break;

            case "salesInventory":
                usc = new usc_sales_inventory();
                GridMain.Children.Add(usc);
                break;

            case "inventoryStocks":
                usc = new usc_inventory();
                GridMain.Children.Add(usc);
                break;

            case "posSettings":
                usc = new usc_pos_settings();
                GridMain.Children.Add(usc);
                break;

            case "categoryButton":
                usc = new usc_category();
                GridMain.Children.Add(usc);
                break;

            case "stockInButton":
                usc = new usc_stock();
                GridMain.Children.Add(usc);
                break;

            case "settingsButton":
                usc = new usc_settings();
                GridMain.Children.Add(usc);
                break;

            case "logoutButton":
                var ans = MessageBox.Show("Are you sure you want to logout?", "Logout", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (ans == MessageBoxResult.Yes)
                {
                    MessageBox.Show("Logout Success!", "Logout", MessageBoxButton.OK, MessageBoxImage.Information);
                    window_userLogin userLogin = new window_userLogin();     // Call UserLogin Window

                    /* Authentication auth = new Authentication("", ""); // Call Auth Class
                     * auth.addTimeInOut(timeIn, accNo); */
                    userLogin.Show(); // Show Login After Logout
                    this.Close();     // Close this window
                }
                break;
            }
        }