public void EditStudents() { if (AccesLevel != AccesLevels.User) { var NewWindow = new EditStudentsWindow(); NewWindow.Top = Application.Current.MainWindow.Top; NewWindow.Left = Application.Current.MainWindow.Left; NewWindow.Height = Application.Current.MainWindow.ActualHeight; NewWindow.Width = Application.Current.MainWindow.ActualWidth; NewWindow.Show(); Application.Current.MainWindow.Close(); Application.Current.MainWindow = NewWindow; } }
private void DrawerContentButton_Click(object sender, RoutedEventArgs e) { var btn = sender as Button; switch (btn.Tag.ToString()) { case "Add Marks": AddMarksWindow amw = new AddMarksWindow(); amw.ShowDialog(); break; case "Add Students": AddStudentsWindow asw = new AddStudentsWindow(); asw.ShowDialog(); break; case "Add Subjects": AddSubjectsWindow asjw = new AddSubjectsWindow(); asjw.ShowDialog(); break; case "Add Classes": AddClassesWindow acw = new AddClassesWindow(); acw.ShowDialog(); break; case "Delete Marks": DeleteMarksWindow dmw = new DeleteMarksWindow(); dmw.ShowDialog(); break; case "Delete Students": DeleteStudentsWindow dsw = new DeleteStudentsWindow(); dsw.ShowDialog(); break; case "Delete Subjects": DeleteSubjectsWindow dsjw = new DeleteSubjectsWindow(); dsjw.ShowDialog(); break; case "Delete Classes": DeleteClassesWindow dcw = new DeleteClassesWindow(); dcw.ShowDialog(); break; case "Edit Marks": EditMarksWindow emw = new EditMarksWindow(); emw.ShowDialog(); break; case "Edit Students": EditStudentsWindow esw = new EditStudentsWindow(); esw.ShowDialog(); break; case "Edit Subjects": EditSubjectsWindow esjw = new EditSubjectsWindow(); esjw.ShowDialog(); break; case "Edit Classes": EditClassesWindow ecw = new EditClassesWindow(); ecw.ShowDialog(); break; } }