private async void DeleteCourseBtn_Click(object sender, RoutedEventArgs e) { IParentWindow parent = ParentFinder.FindParent <AdminPanelWindow>(this); MessageDialogResult r = await parent.ShowMessage("Warning", "Are you sure you want to delete this course", MessageDialogStyle.AffirmativeAndNegative); if (r == MessageDialogResult.Negative) { return; } Button btn = (Button)sender; CourseModel model = new CourseModel(); model = (CourseModel)btn.Tag; // TODO - Delete the selected department if (GlobalConfig.Connection.DeleteCourse_ById(model.Id)) { Courses.Remove(model); WireUpLists(); // TODO - Delete the selected term } else { await parent.ShowMessage("Deletion Error", "The selected course can't be deleted beacause it has an exam", MessageDialogStyle.Affirmative); // TODO - ADD a MessageBox } }
public override void ShowChildWindow(IParentWindow parentWindow = null) { //if (ParentWindow != null) // ParentWindow.RegisterChildWindow(this); if (SelectedNotifier != null) { LogFileNotifier thisNotifier = (LogFileNotifier)SelectedNotifier; LogFileNotifierConfig currentConfig = (LogFileNotifierConfig)thisNotifier.AgentConfig; if (File.Exists(currentConfig.GetCurrentLogFileName())) { try { System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo = new System.Diagnostics.ProcessStartInfo() { FileName = currentConfig.GetCurrentLogFileName() }; p.Start(); } catch { } } else { System.Windows.Forms.MessageBox.Show("Log file not found or it might be empty!", "Log file", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); } } }
private async void DeleteAssignmentBtn_Click(object sender, RoutedEventArgs e) { IParentWindow parent = ParentFinder.FindParent <AdminPanelWindow>(this); MessageDialogResult r = await parent.ShowMessage("Warning", "Are you sure you want to delete this assginment", MessageDialogStyle.AffirmativeAndNegative); if (r == MessageDialogResult.Negative) { return; } // // TODO - Delete the selected Assignment AssignmentModel model = (AssignmentModel)assignmentsGrid.SelectedItem; if (GlobalConfig.Connection.DeleteAssignment_ById(model.Id)) { Assignments.Remove(model); WireUpLists(Assignments); // TODO - Delete the selected term } else { await parent.ShowMessage("Deletion Error", "The selected assignment can't be deleted beacause it has an exam", MessageDialogStyle.Affirmative); // TODO - ADD a MessageBox } }
public override void ShowChildWindow(IParentWindow parentWindow = null) { //if (ParentWindow != null) // ParentWindow.RegisterChildWindow(this); if (SelectedNotifier != null) { EventLogNotifier thisNotifier = (EventLogNotifier)SelectedNotifier; EventLogNotifierConfig currentConfig = (EventLogNotifierConfig)thisNotifier.AgentConfig; string command = "eventvwr.exe"; try { System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo = new System.Diagnostics.ProcessStartInfo() { FileName = command }; if (currentConfig.MachineName.Length > 1) { p.StartInfo.Arguments = "\\\\" + currentConfig.MachineName; } p.Start(); } catch { } } }
public void ShowChildWindow(IParentWindow parentWindow = null) { if (parentWindow != null) { ParentWindow = parentWindow; } if (ParentWindow != null) { ParentWindow.RegisterChildWindow(this); } Show(); }
public void ShowChildWindow(IParentWindow parentWindow = null) { if (parentWindow != null) { ParentWindow = parentWindow; } if (ParentWindow != null) { ParentWindow.RegisterChildWindow(this); } if (this.WindowState == FormWindowState.Minimized) { this.WindowState = FormWindowState.Normal; } this.Show(); this.TopMost = true; this.TopMost = false; RefreshDisplayData(); }
public AddObservationViewModel(int patientId, IParentWindow caller) { base.DisplayName = "Ajouter une observation"; this._observationService = new CSObservation(); this._patientId = patientId; this._caller = caller; this._weight = 0; this._bloodPressure = 0; this._prescriptionItem = ""; this.Prescription = new ObservableCollection <string>(); this._picture = ""; this.Pictures = new ObservableCollection <byte[]>(); this._comment = ""; this.SaveCommand = new RelayCommand(param => Save(), param => MainWindowViewModel.CheckUserRole()); this.CancelCommand = new RelayCommand(param => Cancel(), param => true); this.AddPrescriptionItemCommand = new RelayCommand(param => AddPrescriptionItem(), param => this.PrescriptionItem != null && this.PrescriptionItem.Length > 0); this.AddPictureCommand = new RelayCommand(param => AddPictureItem(), param => this.Picture != null && this.Picture.Length > 0); this.OpenFileCommand = new RelayCommand(param => OpenImageExplorer(), param => true); }
public AddPatientViewModel(IParentWindow caller) : this() { this._caller = caller; }
public AddUserViewModel(IParentWindow caller) : this() { this._caller = caller; }
public WPFPresenterNavigation(IParentWindow window) { MainWindow = window; }
public virtual void ShowChildWindow(IParentWindow parentWindow = null) { }