コード例 #1
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (data.getUsername() == null)
            {
                MessageBox.Show("Please enter your login credentials.");
                return;
            }

            UserControl usc = null;

            GridMain.Children.Clear();

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

            case "ItemFindName":
                usc = new UserControlFindName(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemRegister":
                usc = new UserControlRegisterCourses(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemRegisterStudents":
                usc = new UserControlRegisterStudents(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemRegisterCourseRegistrationTable":
                usc = new UserControlCourseRegistrationTable(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemRevertCourseReg":
                usc = new UserControlRevertCourseReg(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemBackup":
                Backup();
                break;

            case "ItemRestore":
                Restore();
                break;

            default:
                break;
            }
        }
コード例 #2
0
        private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            UserControl usc = null;

            GridMain.Children.Clear();

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

            case "ItemFindName":
                usc = new UserControlFindName(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemRegister":
                usc = new UserControlRegisterCourses(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemRegisterStudents":
                usc = new UserControlRegisterStudents(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemRegisterCourseRegistrationTable":
                usc = new UserControlCourseRegistrationTable(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemRevertCourseReg":
                usc = new UserControlRevertCourseReg(data);
                GridMain.Children.Add(usc);
                break;

            case "ItemBackup":
                Backup();
                break;

            case "ItemRestore":
                Restore();
                break;

            default:
                break;
            }
        }