private void RemoveAll() { MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Voulez-vous tout supprimer ?", "Confimez la suppression", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { ObservableResources.Clear(); IsEdited = true; } }
private void Validate(Resource resource) { if (resource == null) { return; } resource.IsEditMode = false; var edit = _tobeEdited == null?ObservableResources.FirstOrDefault(r => r.Id == 0) : ObservableResources.FirstOrDefault(r => r.Id == _tobeEdited.Id); if (edit != null) { edit.Id = resource.Id; edit.Job = resource.Job; edit.Name = resource.Name; edit.IsEditMode = resource.IsEditMode; edit.PhoneNumber = resource.PhoneNumber; edit.IsPresent = resource.IsPresent; edit.Email = resource.Email; } _tobeEdited = null; }
private void Add() { ObservableResources.Add(new Resource()); IsEdited = true; }