Esempio n. 1
0
 public static string RenderArtistProfileImageThumbnail(this HtmlHelper helper, Artist artist, string id, string alternateText, object htmlAttributes)
 {
     ImageMetaData imageMetaData = null;
     if(artist.ProfileImage!=null && artist.ProfileImage.Thumbnail!=null){
         imageMetaData = artist.ProfileImage.Thumbnail;
     }
     return RenderArtistProfileImageThumbnail(helper, imageMetaData, id, alternateText, htmlAttributes);
 }
Esempio n. 2
0
 public static string RenderArtistProfileImage(this HtmlHelper helper, Artist artist)
 {
     ImageMetaData imageMetaData = null;
     if (artist.ProfileImage != null)
     {
         imageMetaData = artist.ProfileImage;
     }
     return RenderArtistProfileImageThumbnail(helper, imageMetaData, "", "", null);
 }
Esempio n. 3
0
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            HttpRequestBase request = controllerContext.HttpContext.Request;

            string prefix = ModelBinderHelpers.GetPrefixForCustomModelBinder(bindingContext);

            Artist artist = null;
            if (bindingContext.Model == null)
            {
                artist = new Artist();
                artist.ID = Guid.NewGuid();
            }
            else
            {
                artist = (Artist)bindingContext.Model;
            }

            artist.Name = ModelBinderHelpers.GetValueAndUpdateModelState<string>(bindingContext, prefix + "Name");
            artist.Profile = ModelBinderHelpers.GetValueAndUpdateModelState<string>(bindingContext, prefix + "Profile");

            //Grab the style
            Guid? styleId = ModelBinderHelpers.GetValueAndUpdateModelState<Guid?>(bindingContext, "SelectedStyle");
            ListenTo.Shared.DO.Style style = null;
            if (styleId.HasValue && styleId.Value != Guid.Empty)
            {
                style = StyleManager.GetByID(styleId.Value);
                artist.Style = style;
            }

            //Grab the town
            Guid? townId = ModelBinderHelpers.GetValueAndUpdateModelState<Guid?>(bindingContext, "SelectedTown");
            Town town = null;
            if (townId.HasValue && townId.Value!=Guid.Empty)
            {
                town = TownManager.GetByID(townId.Value);
                artist.Town = town;
            }

            int month = ModelBinderHelpers.GetValueAndUpdateModelState<int>(bindingContext, "month");
            int year = ModelBinderHelpers.GetValueAndUpdateModelState<int>(bindingContext, "year");
            DateTime formedDateTime = new DateTime(year, month, 1);

            artist.Created = DateTime.Now;
            artist.Formed = formedDateTime;

            artist.OfficalWebsiteURL = ModelBinderHelpers.GetValueAndUpdateModelState<string>(bindingContext, prefix + "OfficalWebsiteURL");
            artist.Email = ModelBinderHelpers.GetValueAndUpdateModelState<string>(bindingContext, prefix + "Email");
            artist.ProfileAddress = ModelBinderHelpers.GetValueAndUpdateModelState<string>(bindingContext, prefix + "ProfileAddress");

            OwnershipHelpers.SetOwner((IOwnableDO)artist, controllerContext.HttpContext.User);

            return artist;
        }
Esempio n. 4
0
        private void PrepareViewDataForEditAction(Artist artist)
        {
            Guid? townId = null;
            if (artist.Town != null)
            {
                townId = artist.Town.ID;
            }
            PrepareTowns(townId);

            Guid? styleId = null;
            if (artist.Style != null)
            {
                styleId = artist.Style.ID;
            }
            PrepareStyles(styleId);

            PrepareFormedDate(artist.Formed);
        }
Esempio n. 5
0
 private bool IsUserFanOfArtist(Artist artist)
 {
     bool isUserFanOfArtist = false;
     if(this.HttpContext.User.Identity.IsAuthenticated) {
         IListenToUser user = (IListenToUser)this.HttpContext.User;
         isUserFanOfArtist = RelationshipManager.IsUserFanOfArtist(user.UserCredentials, artist.ID,user.UserId);
     }
     return isUserFanOfArtist;
 }
Esempio n. 6
0
 public string ArtistMusicUrl(Artist artist)
 {
     return UrlHelper.RouteUrl(Routes.ARTIST_MUSIC, new { name = artist.ProfileAddress });
 }
Esempio n. 7
0
 public string ArtistGigsUrl(Artist artist)
 {
     return UrlHelper.RouteUrl(Routes.ARTIST_GIGS, new { name = artist.ProfileAddress });
 }
Esempio n. 8
0
 public string ViewArtistUrl(Artist artist)
 {
     return UrlHelper.RouteUrl(Routes.ARTIST, new { name = artist.ProfileAddress });
 }
Esempio n. 9
0
 public string EditArtistUrl(Artist artist)
 {
     return UrlHelper.RouteUrl(Routes.ARTIST_EDIT, new { id = artist.ID });
 }
Esempio n. 10
0
 public string BecomeAFanUrl(Artist artist)
 {
     return UrlHelper.RouteUrl(Routes.ARTIST_BECOME_A_FAN, new { profileAddress = artist.ProfileAddress });
 }
Esempio n. 11
0
        private void AddActToGig(Gig gig, Artist artist, string name)
        {
            Act currentAct = new Act();
            currentAct.ID = Guid.NewGuid();
            currentAct.GigId = gig.ID;
            if (artist!=null)
            {
                currentAct.Name = artist.Name;
                currentAct.Artist = artist;
            }
            else
            {
                currentAct.Name = name;
            }

            gig.Acts.Add(currentAct);
        }
Esempio n. 12
0
 public static string EditArtistUrl(this HtmlHelper helper, Artist artist)
 {
     return IOCHelper.GetRouteHelpers().EditArtistUrl(artist);
 }
Esempio n. 13
0
 public static string BecomeAFanUrl(this HtmlHelper helper, Artist artist)
 {
     return IOCHelper.GetRouteHelpers().BecomeAFanUrl(artist);
 }
Esempio n. 14
0
 public static string ArtistMusicUrl(this HtmlHelper helper, Artist artist)
 {
     return IOCHelper.GetRouteHelpers().ArtistMusicUrl(artist);
 }
Esempio n. 15
0
 public RedirectToRouteResult RedirectToArtist(Artist artist)
 {
     return RedirectToRoute(Routes.ARTIST, new { name = artist.ProfileAddress  });
 }
Esempio n. 16
0
 public static string RenderArtistProfileImageThumbnail(this HtmlHelper helper, Artist artist)
 {
     return RenderArtistProfileImageThumbnail(helper,artist,"","",null);
 }