Ejemplo n.º 1
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;
            }
        }
 public report_sales(usc_sales_inventory s, string report1)
 {
     InitializeComponent();
     usc_sales     = s;
     reportToPrint = report1;
 }