private void delete() { MessageBoxResult result = MessageBoxResult.None; localizeMessageBox(() => { result = MessageBox.Show(string.Format(fa_IR.DeletingEmployeeConfirmation, CurrentEmployee.FullName, CurrentEmployee.EmployeeID), string.Format(fa_IR.DeletingEmployee, CurrentEmployee.FullName), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No, MessageBoxOptions.RightAlign ); }); if (result == MessageBoxResult.Yes) { string fullName = CurrentEmployee.FirstName + " " + CurrentEmployee.LastName ?? string.Empty; string employeeId = CurrentEmployee.EmployeeID.ToString() ?? string.Empty; FaceRecognitionService.DeleteFace(CurrentEmployee.ID.ToString()); AutomatedAttendanceSystem.DeleteEmployee(CurrentEmployee); Messenger.Default.Send <Notification, MainViewModel>(new Notification() { Message = string.Format(fa_IR.EmployeeHasBeenDeletedSuccessfully, fullName, employeeId), Type = NotificationType.Info }); Messenger.Default.Send <Messages, MainViewModel>(Messages.Update); RaisePropertyChanged(() => HasRecord); Messenger.Default.Send <Messages, MainViewModel>(Messages.HideEmployeeView); } else { Messenger.Default.Send <Messages, MainViewModel>(Messages.HideEmployeeView); } }