Exemple #1
0
        public void LoadGenre(GenreMetaData genreMetaData)
        {
            _isLoading = true;

            _genreMetaData = genreMetaData;
            genremetadatasource.DataSource = _genreMetaData;
            _status = GenreMetaDataStatus.Normal;

            _isLoading = false;
        }
        private void AddGenreMetaData()
        {
            SaveCurrentGenreMetaData();

            var e = from Object li in lbGenreMetadata.Items
                    where li.ToString() == "New Genre"
                    select li;

            if (e.Count() == 0)
            {
                GenreMetaData gmd = new GenreMetaData();
                gmd.Name = "New Genre";

                lbGenreMetadata.Items.Add(gmd);
                lbGenreMetadata.SelectedItem = gmd;

                TitleCollectionManager.AddGenreMetaData(gmd);

                genreMetaDataEditor.LoadGenre((GenreMetaData)gmd);
            }
            else
            {
                lbGenreMetadata.SelectedItem = e.First();
            }

            SetupFilterListContextMenu();
        }
 public static void RemoveGenreMetaData(GenreMetaData gm)
 {
     // delete the image if it exists
     if (gm.DaoGenreMetaData.PhotoID != null)
     {
         Dao.TitleCollectionDao.SetDeleteImage((int)gm.DaoGenreMetaData.PhotoID);
     }
     Dao.DBContext.Instance.GenreMetaDatas.DeleteOnSubmit(gm.DaoGenreMetaData);
     Dao.DBContext.Instance.SubmitChanges();
 }
 public static void AddGenreMetaData(GenreMetaData gm)
 {
     UpdatesImagesForGenreMetaData(gm.DaoGenreMetaData);
     Dao.DBContext.Instance.GenreMetaDatas.InsertOnSubmit(gm.DaoGenreMetaData);
     Dao.DBContext.Instance.SubmitChanges();
 }