public void DeleteMaintenanceExecute() { try { if (service.DeleteUser(selectedMaintenance.ClinicUserId) == true) { Logging.LoggAction("MaintainancViewModel", "Info", "Succesfull deleted maintainanc"); } ListOFMaintenance = new ObservableCollection <vwMaintenance>(service.GetAllvwMaintainancList()); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void DeleteManagerExecute() { try { if (service.DeleteUser(selectedPatient.ClinicUserId) == true) { Logging.LoggAction("PatientViewModel", "Info", "Succesfull deleted patient"); } ListOfPatients = new ObservableCollection <vwPatient>(service.GetAllvwPatientsList()); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void DeleteDoctorExecute() { try { if (service.DeleteUser(selectedDoctor.ClinicUserId) == true) { Logging.LoggAction("DoctorViewModel", "Info", "Succesfull deleted doctor"); } ListOfDoctors = new ObservableCollection <vwDoctor>(service.GetAllvwDoctorsList()); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void DeleteExecute() { try { MessageBoxResult result = MessageBox.Show("Are you sure you want to delete employee ?", "Deleting employee", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { User userDeleted = new User(); userDeleted.UserId = SelectedUser.UserId; if (service.DeleteUser(userDeleted.UserId)) { MessageBox.Show("You have successfully deleted employee"); ListOfWorkers = new ObservableCollection <User>(service.GettAllUsers()); Thread t = new Thread(() => { Logging.LoggAction("Delete emplyee", "Success", "Succesfully deleted emplyee"); }); t.IsBackground = true; t.Start(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }