public override void SubmitCommand_Execute(object obj) { if (IsValid) { PravnoLice pl = obj as PravnoLice; IBusinessLayerFacade <PravnoLice> bl = new PravnoLiceBusinessLayerImplementation(); if (pl.Id != 0) { bl.Update(pl); } else { bl.Create(pl); } } else { if (!_SubmitAttempted) { _SubmitAttempted = true; foreach (string property in this.InvalidFields) { OnPropertyChanged(property); } } } }
public override void DeleteCommand_Execute(object obj) { MessageBoxResult result = MessageBox.Show(deleteMessage, "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { IBusinessLayerFacade <PravnoLice> flDelete = new PravnoLiceBusinessLayerImplementation(); flDelete.Delete(obj as PravnoLice); } this.RefreshCollectionOnPage(); }