Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 private void EditGenre(GenreVM genrevm)
 {
     genrevm.ShowEdit = "Hidden";
     genrevm.ShowCancel = "Visible";
     genrevm.ShowSave = "Visible";
     genrevm.Enabled = true;
 }
Esempio n. 4
0
        private void DeleteGenre(GenreVM genrevm)
        {
            if (SelectedGenre == null) return;

            Genre.DeleteGenre(SelectedGenre);

            SelectedGenre = new Genre();
            Enabled = true;
            ShowEdit = "Hidden";
            ShowCancel = "Hidden";
            ShowSave = "Visible";
        }
Esempio n. 5
0
        private void CancelUpdateGenre(GenreVM genrevm)
        {
            // Reset person
            _changeNotify = false;
            SelectedGenre = _oldGenre;

            genrevm.ShowEdit = "Visible";
            genrevm.ShowCancel = "Hidden";
            genrevm.ShowSave = "Hidden";
            Enabled = false;
        }
Esempio n. 6
0
 private void AddGenre(GenreVM genrevm)
 {
     SelectedGenre = new Genre();
     _oldGenre = null;
     genrevm.ShowEdit = "Hidden";
     genrevm.ShowCancel = "Visible";
     genrevm.ShowSave = "Visible";
     genrevm.Enabled = true;
 }