private void LoadRecord() { //TODO LOAD DATA if (IsTeacher) { MainMenu menu = Application.Current.Windows.OfType <MainMenu>().SingleOrDefault(x => x.IsActive); var flyout = menu.Flyouts.Items[0] as Flyout; getTeacherCollection(); // menu.Record.ItemsSource = Students; // } if (flyout == null) { return; } flyout.IsOpen = !flyout.IsOpen; } else { StudentCIView menu = Application.Current.Windows.OfType <StudentCIView>().SingleOrDefault(x => x.IsActive); var flyout = menu.Flyouts.Items[0] as Flyout; getStudentCollection(); // menu.Record.ItemsSource = Students; // } if (flyout == null) { return; } flyout.IsOpen = !flyout.IsOpen; } }
private void Save() { //TODO progress Bar DialogService dia = new DialogService(); if (_dialogService.getText() == "OpenAddTeacher") { MainMenu menu = Application.Current.Windows.OfType <MainMenu>().SingleOrDefault(x => x.IsActive); dia.ProgressDialog(menu, "Saving"); AddNewRecord(); SetIsEnabledDefaults(); if (Response == "success") { dia.progressTerminated(menu, "Saved"); CanSave = true; CanSave = true; CanViewRecord = true; CanViewResult = true; EnableFields(); Reset(); } else { } } else if (_dialogService.getText() == "OpenAddStudent") { StudentCIView menu = Application.Current.Windows.OfType <StudentCIView>().SingleOrDefault(x => x.IsActive); dia.ProgressDialog(menu, "Saving"); AddNewRecord(); SetIsEnabledDefaults(); if (Response == "success") { dia.progressTerminated(menu, "Saved"); CanSave = true; CanSave = true; CanViewRecord = true; CanViewResult = true; EnableFields(); Reset(); } } //End Progress Bar }
private void OpenAddStudent() { // string key = "OpenAdd"; DialogService ms = new DialogService("OpenAddStudent", DateTime.Now); // var MainMenu=SimpleIoc.Default.GetInstance<MainMenuViewModel>(); // MainMenu menu=SimpleIoc.Default.GetInstance<MainMenu>(); var message = new NotificationMessage <DialogService>(this, ms, "MenuOption"); // INavigationDataService openmenu = new NavigationDataService(); // openmenu.NavigateTo(new Uri("/Views/MainMenu.xaml",UriKind.Relative)); // var menu = SimpleIoc.Default.GetInstance<MainMenuViewModel>(); StudentCIView menu = new StudentCIView(); Messenger.Default.Send(message); _navigationService.OpenUI(menu); }