コード例 #1
0
        private void ListViewMenuSelectionChanged(object sender, SelectionChangedEventArgs routedEvent)
        {
            switch (((ListViewItem)((ListView)sender).SelectedItem).Name)
            {
            case "ListViewItemHome":
                if (Login.tokenAccount.memberATEType == Number.NumberValue(NumberValues.ONE))
                {
                    HomeClient home = new HomeClient();
                    home.InitializeMenu();
                    home.Show();
                }
                else
                {
                    HomeEmployee home = new HomeEmployee();
                    home.InitializeMenu();
                    home.Show();
                }
                Close();
                break;

            case "ListViewItemAccountEdit":
                AccountEdition accountEdition = new AccountEdition();
                accountEdition.InitializeMenu();
                accountEdition.Show();
                Close();
                break;

            case "ListViewItemRequest":
                if (Login.tokenAccount.memberATEType == Number.NumberValue(NumberValues.ONE))
                {
                    RequestsMadeList requestsMadeList = new RequestsMadeList();
                    requestsMadeList.InitializeMenu();
                    requestsMadeList.Show();
                }
                else
                {
                    RequestsReceivedList requestReceivedList = new RequestsReceivedList();
                    requestReceivedList.InitializeMenu();
                    requestReceivedList.Show();
                }
                Close();
                break;

            case "ListViewItemServiceRegistration":
                if (Login.tokenAccount.memberATEType == Number.NumberValue(NumberValues.ONE))
                {
                    AccountActivate accountActivate = new AccountActivate();
                    accountActivate.InitializeMenu();
                    accountActivate.Show();
                }
                else
                {
                    ServiceRegistry serviceRegistry = new ServiceRegistry();
                    serviceRegistry.InitializeMenu();
                    serviceRegistry.Show();
                }
                Close();
                break;

            case "ListViewItemCommentTracing":
                if (Login.tokenAccount.memberATEType == Number.NumberValue(NumberValues.ONE))
                {
                    CommentClient commentClient = new CommentClient();
                    commentClient.InitializeMenu();
                    commentClient.Show();
                }
                else
                {
                    ReportGeneration reportGeneration = new ReportGeneration();
                    reportGeneration.InitializeMenu();
                    reportGeneration.Show();
                }
                Close();
                break;

            default:
                break;
            }
        }