当前位置: 首页>>代码示例>>C#>>正文


C# Artist.GetArtistByAltname方法代码示例

本文整理汇总了C#中Artist.GetArtistByAltname方法的典型用法代码示例。如果您正苦于以下问题:C# Artist.GetArtistByAltname方法的具体用法?C# Artist.GetArtistByAltname怎么用?C# Artist.GetArtistByAltname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Artist的用法示例。


在下文中一共展示了Artist.GetArtistByAltname方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProfileDetail


//.........这里部分代码省略.........
            }

            if (uadLooker != null &&
                (_mu != null && _ua.UserAccountID > 0 && uadLooker.EnableProfileLogging && uad.EnableProfileLogging))
            {
                var pl = new ProfileLog
                {
                    LookedAtUserAccountID = _ua.UserAccountID,
                    LookingUserAccountID = Convert.ToInt32(_mu.ProviderUserKey)
                };

                if (pl.LookingUserAccountID != pl.LookedAtUserAccountID) pl.Create();

                ArrayList al = ProfileLog.GetRecentProfileViews(_ua.UserAccountID);

                if (al != null && al.Count > 0)
                {
                    var uas = new UserAccounts();

                    foreach (UserAccount viewwer in al.Cast<int>().Select(id =>
                        new UserAccount(id))
                        .Where(viewwer => !viewwer.IsLockedOut && viewwer.IsApproved)
                        .TakeWhile(viewwer => uas.Count < Maxcountusers))
                    {
                        uas.Add(viewwer);
                    }
                }
            }

            GetUserAccountVideos();

            // this is either a youtube user or this is a band
            var art = new Artist();
            art.GetArtistByAltname(userName);

            if (art.ArtistID > 0)
            {
                // try this way for dashers
                model.UserName = art.Name;
            }

            var vids = new Videos();
            var sngrs = new SongRecords();

            if (art.ArtistID == 0)
            {
                vids.GetAllVideosByUser(userName);

                var uavs = new UserAccountVideos();
                uavs.GetRecentUserAccountVideos(_ua.UserAccountID, 'U');

                foreach (Video f2 in uavs.Select(uav1 => new Video(uav1.VideoID)).Where(f2 => !vids.Contains(f2)))
                {
                    vids.Add(f2);
                }

                vids.Sort((x, y) => (y.PublishDate.CompareTo(x.PublishDate)));

                model.UserName = _ua != null ? _ua.UserName : userName;
            }
            else
            {
                GetArtistProfile(art, vids);
            }

            vids.Sort((p1, p2) => p2.PublishDate.CompareTo(p1.PublishDate));
开发者ID:dasklub,项目名称:kommunity,代码行数:67,代码来源:ProfileController.cs

示例2: VideoSubmit


//.........这里部分代码省略.........

                //// genre
                //if (!string.IsNullOrWhiteSpace(this.ddlGenre.SelectedValue)
                //    && this.ddlGenre.SelectedValue != selectText)
                //{
                //    propTyp = new PropertyType(SiteEnums.PropertyTypeCode.GENRE);
                //    mp = new MultiProperty(vid.VideoID, propTyp.PropertyTypeID, SiteEnums.MultiPropertyType.VIDEO);
                //    MultiPropertyVideo.DeleteMultiPropertyVideo(mp.MultiPropertyID, vid.VideoID);
                //    mp.RemoveCache();
                //    MultiPropertyVideo.AddMultiPropertyVideo(
                //        Convert.ToInt32(ddlGenre.SelectedValue), vid.VideoID);
                //}

                //// difficulty
                //if (!string.IsNullOrWhiteSpace(this.ddlDifficultyLevel.SelectedValue)
                //    && this.ddlDifficultyLevel.SelectedValue != selectText)
                //{
                //    propTyp = new PropertyType(SiteEnums.PropertyTypeCode.DIFFC);
                //    mp = new MultiProperty(vid.VideoID, propTyp.PropertyTypeID, SiteEnums.MultiPropertyType.VIDEO);
                //    MultiPropertyVideo.DeleteMultiPropertyVideo(mp.MultiPropertyID, vid.VideoID);
                //    mp.RemoveCache();
                //    MultiPropertyVideo.AddMultiPropertyVideo(
                //        Convert.ToInt32(this.ddlDifficultyLevel.SelectedValue), vid.VideoID);
                //}

                //VideoSong.DeleteSongsForVideo(vid.VideoID);

                // song 1

                Artist artst = new Artist(band.Trim());

                if (artst.ArtistID == 0)
                {
                    artst.GetArtistByAltname(band.Trim());
                }

                if (artst.ArtistID == 0)
                {
                    artst.Name = band.Trim();
                    artst.AltName = FromString.URLKey(artst.Name);
                    artst.Create();
                }

                Song sng = new Song(artst.ArtistID, song.Trim());

                if (sng.SongID == 0)
                {
                    sng.Name = sng.Name.Trim();
                    sng.SongKey = FromString.URLKey(sng.Name);
                    sng.Create();
                }

                VideoSong.AddVideoSong(sng.SongID, vid.VideoID, 1);

                //  RefreshLists();

                //                lblStatus.Text = "OK";

                if (vid.VideoID > 0)
                {
                    Response.Redirect(vid.VideoURL);// just send them to it
                }
            }
            catch
            {
                //              lblStatus.Text = ex.Message;
开发者ID:pakoito,项目名称:web,代码行数:67,代码来源:HomeController.cs

示例3: VideoSubmit


//.........这里部分代码省略.........

            vid.VolumeLevel = 5;

            if (string.IsNullOrWhiteSpace(vid.ProviderKey))
            {
                // invalid
                vir.StatusType = InvalidStatus;
                Response.Redirect(invalidSubmissionLink);
                return new EmptyResult();
            }

            if (vid.VideoID == 0)
            {
                vid.IsHidden = false;
                vid.IsEnabled = true;
                vid.Create();
            }
            else
            {
                // just go to the video...
                vid.Update();
                Response.Redirect(vid.VideoURL);
            }

            // if there is a contest, add it now since there is an id
            int subContestId;

            if (!string.IsNullOrWhiteSpace(contestID) &&
                int.TryParse(contestID, out subContestId) &&
                subContestId > 0)
            {
                //TODO: check if it already is in the contest

                ContestVideo.DeleteVideoFromAllContests(vid.VideoID);

                var cv = new ContestVideo {ContestID = subContestId, VideoID = vid.VideoID};

                cv.Create();
            }
            else
            {
                // TODO: JUST REMOVE FROM CURRENT CONTEST, NOT ALL
                ContestVideo.DeleteVideoFromAllContests(vid.VideoID);
            }

            // vid type
            var propTyp = new PropertyType(SiteEnums.PropertyTypeCode.VIDTP);
            var mp = new MultiProperty(vid.VideoID, propTyp.PropertyTypeID, SiteEnums.MultiPropertyType.VIDEO);
            MultiPropertyVideo.DeleteMultiPropertyVideo(mp.MultiPropertyID, vid.VideoID);
            mp.RemoveCache();
            MultiPropertyVideo.AddMultiPropertyVideo(Convert.ToInt32(videoType), vid.VideoID);

            // human
            propTyp = new PropertyType(SiteEnums.PropertyTypeCode.HUMAN);
            mp = new MultiProperty(vid.VideoID, propTyp.PropertyTypeID, SiteEnums.MultiPropertyType.VIDEO);
            MultiPropertyVideo.DeleteMultiPropertyVideo(mp.MultiPropertyID, vid.VideoID);
            mp.RemoveCache();
            MultiPropertyVideo.AddMultiPropertyVideo(Convert.ToInt32(personType), vid.VideoID);

            // footage
            propTyp = new PropertyType(SiteEnums.PropertyTypeCode.FOOTG);
            mp = new MultiProperty(vid.VideoID, propTyp.PropertyTypeID, SiteEnums.MultiPropertyType.VIDEO);
            MultiPropertyVideo.DeleteMultiPropertyVideo(mp.MultiPropertyID, vid.VideoID);
            mp.RemoveCache();
            MultiPropertyVideo.AddMultiPropertyVideo(Convert.ToInt32(footageType), vid.VideoID);

            // song 1
            var artst = new Artist(band.Trim());

            if (artst.ArtistID == 0)
            {
                artst.GetArtistByAltname(band.Trim());
            }

            if (artst.ArtistID == 0)
            {
                artst.Name = band.Trim();
                artst.AltName = FromString.UrlKey(artst.Name);
                artst.Create();
            }

            var sng = new Song(artst.ArtistID, song.Trim());

            if (sng.SongID == 0)
            {
                sng.Name = sng.Name.Trim();
                sng.SongKey = FromString.UrlKey(sng.Name);
                sng.Create();
            }

            // BUG: DON'T ADD 2X
            VideoSong.AddVideoSong(sng.SongID, vid.VideoID, 1);

            if (vid.VideoID > 0)
            {
                Response.Redirect(vid.VideoURL); // just send them to it
            }

            return new EmptyResult();
        }
开发者ID:dasklub,项目名称:kommunity,代码行数:101,代码来源:HomeController.cs

示例4: ProfileDetail


//.........这里部分代码省略.........
            {
                uavs = new UserAccountVideos();

                uavs.GetRecentUserAccountVideos(ua.UserAccountID, 'F');

                if (uavs.Count > 0)
                {
                    Videos favvids = new Videos();
                    Video f1 = new Video();

                    foreach (UserAccountVideo uav1 in uavs)
                    {
                        f1 = new Video(uav1.VideoID);
                        if (f1.IsEnabled) favvids.Add(f1);
                    }

                    SongRecord sng1 = null;
                    SongRecords sngrcds2 = new SongRecords();

                    foreach (Video v1 in favvids)
                    {
                        sng1 = new SongRecord(v1);
                        sngrcds2.Add(sng1);
                    }

                    sngrcds2.IsUserSelected = true;

                    ViewBag.UserFavorites = sngrcds2.VideosList();//.ListOfVideos();
                }
            }

            // this is either a youtube user or this is a band
            Artist art = new Artist(  );
            art.GetArtistByAltname(userName);

            if (art.ArtistID > 0)
            {
                // try this way for dashers
                model.UserName = art.Name;
            }

            Videos vids = new Videos();
            SongRecords sngrs = new SongRecords();

            if (art.ArtistID == 0)
            {
                vids.GetAllVideosByUser(userName);

                uavs = new UserAccountVideos();
                uavs.GetRecentUserAccountVideos(ua.UserAccountID, 'U');

                Video f2 = null;

                foreach (UserAccountVideo uav1 in uavs)
                {
                    f2 = new Video(uav1.VideoID);

                    if (!vids.Contains(f2)) vids.Add(f2);
                }

                vids.Sort((Video x, Video y) => (y.PublishDate.CompareTo(x.PublishDate)));

                model.UserName = userName;

            }
            else
开发者ID:pakoito,项目名称:web,代码行数:67,代码来源:ProfileController.cs


注:本文中的Artist.GetArtistByAltname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。