示例#1
0
        public Musician(Core core, DataRow musicianRow, MusicianLoadOptions loadOptions)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Musician_ItemLoad);

            if (musicianRow != null)
            {
                loadItemInfo(typeof(Musician), musicianRow);

                /* TODO */
                /*if ((loadOptions & MusicianLoadOptions.Info) == MusicianLoadOptions.Info)
                {
                    musicianInfo = new UserGroupInfo(core, groupRow);
                }/*/

                if ((loadOptions & MusicianLoadOptions.Icon) == MusicianLoadOptions.Icon)
                {
                    loadIcon(musicianRow);
                }
            }
            else
            {
                throw new InvalidMusicianException();
            }
        }
示例#2
0
        public static SelectQuery GetSelectQueryStub(Core core, MusicianLoadOptions loadOptions)
        {
            SelectQuery query = new SelectQuery(GetTable(typeof(Musician)));
            query.AddFields(Musician.GetFieldsPrefixed(core, typeof(Musician)));

            if ((loadOptions & MusicianLoadOptions.Icon) == MusicianLoadOptions.Icon)
            {
                query.AddJoin(JoinTypes.Left, new DataField(typeof(Musician), "musician_icon"), new DataField("gallery_items", "gallery_item_id"));
                query.AddField(new DataField("gallery_items", "gallery_item_uri"));
                query.AddField(new DataField("gallery_items", "gallery_item_parent_path"));
            }

            return query;
        }