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); }
public static string RenderArtistProfileImage(this HtmlHelper helper, Artist artist) { ImageMetaData imageMetaData = null; if (artist.ProfileImage != null) { imageMetaData = artist.ProfileImage; } return RenderArtistProfileImageThumbnail(helper, imageMetaData, "", "", null); }
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; }
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); }
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; }
public string ArtistMusicUrl(Artist artist) { return UrlHelper.RouteUrl(Routes.ARTIST_MUSIC, new { name = artist.ProfileAddress }); }
public string ArtistGigsUrl(Artist artist) { return UrlHelper.RouteUrl(Routes.ARTIST_GIGS, new { name = artist.ProfileAddress }); }
public string ViewArtistUrl(Artist artist) { return UrlHelper.RouteUrl(Routes.ARTIST, new { name = artist.ProfileAddress }); }
public string EditArtistUrl(Artist artist) { return UrlHelper.RouteUrl(Routes.ARTIST_EDIT, new { id = artist.ID }); }
public string BecomeAFanUrl(Artist artist) { return UrlHelper.RouteUrl(Routes.ARTIST_BECOME_A_FAN, new { profileAddress = artist.ProfileAddress }); }
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); }
public static string EditArtistUrl(this HtmlHelper helper, Artist artist) { return IOCHelper.GetRouteHelpers().EditArtistUrl(artist); }
public static string BecomeAFanUrl(this HtmlHelper helper, Artist artist) { return IOCHelper.GetRouteHelpers().BecomeAFanUrl(artist); }
public static string ArtistMusicUrl(this HtmlHelper helper, Artist artist) { return IOCHelper.GetRouteHelpers().ArtistMusicUrl(artist); }
public RedirectToRouteResult RedirectToArtist(Artist artist) { return RedirectToRoute(Routes.ARTIST, new { name = artist.ProfileAddress }); }
public static string RenderArtistProfileImageThumbnail(this HtmlHelper helper, Artist artist) { return RenderArtistProfileImageThumbnail(helper,artist,"","",null); }