コード例 #1
0
        public void EditUser(Object o)
        {
            if (selectedStringPerson != null)
            {
                if (selectedStringPerson == "Underviser")
                {
                    TeacherCuView tview = new TeacherCuView((TeacherEx)SelectedUser);
                    tview.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    tview.ShowDialog();
                    tview.Closing += tview_Closing; // den kører ikke videre indtil viewet lukker.
                }

                if (selectedStringPerson == "Elev")
                {
                    StudentCuView sview = new StudentCuView((Student)SelectedUser);
                    sview.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    sview.ShowDialog();
                    sview.Closing += sview_Closing;
                }

                if (selectedStringPerson == "Forældre")
                {
                    ParentCuView pview = new ParentCuView((ParentEx)SelectedUser);
                    pview.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    pview.ShowDialog();
                    pview.Closing += pview_Closing;
                }

                SelectedStringPerson = selectedStringPerson;
            }
        }
コード例 #2
0
        public async void CreateParent(Object o)
        {
            bool done = await GetClasses(); // så åbner den først vinduet når kriterierne er opfyldt! smart :)

            ParentCuView pview = new ParentCuView();

            pview.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            pview.ShowDialog();
            pview.Closing += pview_Closing;
            // GetParents();
            SelectedStringPerson = "Forældre"; // heri bliver der kaldt GetParents();
        }