private void SelectionChanged(GenreVM genrevm) { if (SelectedGenre == null) return; if (ShowCancel == "Visible") CancelUpdateGenre(this); _oldGenre = SelectedGenre.Copy(); genrevm.ShowEdit = "Visible"; genrevm.ShowCancel = "Hidden"; genrevm.ShowSave = "Hidden"; Enabled = false; }
private void SaveUpdateGenre(GenreVM genrevm) { if (!SelectedGenre.IsValid()) return; // Save Changes if (_oldGenre == null) { // Insert into db SelectedGenre.ID = Genre.AddGenre(SelectedGenre); } else { // Update db Genre.UpdateGenre(SelectedGenre); } // Update GUI genrevm.ShowEdit = "Visible"; genrevm.ShowCancel = "Hidden"; genrevm.ShowSave = "Hidden"; Enabled = false; }
private void EditGenre(GenreVM genrevm) { genrevm.ShowEdit = "Hidden"; genrevm.ShowCancel = "Visible"; genrevm.ShowSave = "Visible"; genrevm.Enabled = true; }
private void DeleteGenre(GenreVM genrevm) { if (SelectedGenre == null) return; Genre.DeleteGenre(SelectedGenre); SelectedGenre = new Genre(); Enabled = true; ShowEdit = "Hidden"; ShowCancel = "Hidden"; ShowSave = "Visible"; }
private void CancelUpdateGenre(GenreVM genrevm) { // Reset person _changeNotify = false; SelectedGenre = _oldGenre; genrevm.ShowEdit = "Visible"; genrevm.ShowCancel = "Hidden"; genrevm.ShowSave = "Hidden"; Enabled = false; }
private void AddGenre(GenreVM genrevm) { SelectedGenre = new Genre(); _oldGenre = null; genrevm.ShowEdit = "Hidden"; genrevm.ShowCancel = "Visible"; genrevm.ShowSave = "Visible"; genrevm.Enabled = true; }