public void ToAddAppointmentTab() { if (SelectedUser != null) { if (SelectedUser.Role == "Patient") { var addAppointmentWindow = new AddAppointment(SelectedUser.IdUser); var activeWindow = Application.Current.Windows.OfType <Window>().SingleOrDefault(x => x.IsActive); addAppointmentWindow.Show(); activeWindow.Close(); } else { MessageBox.Show("This is not a patient!"); } } else { MessageBox.Show("Please select a user"); } }
private void allAddApp_button_Click(object sender, EventArgs e) { AddAppointment aa = new AddAppointment(); aa.Show(); }
private void MenuItem_Click(object sender, RoutedEventArgs e) { AddAppointment appt = new AddAppointment(); appt.Show(); }