public string SavePersonalityMediaVimeo(string name, PersonalityCategory category, VimeoApiResult youTubeData) { var media = new Media() { Title = name }; new MediaService().CreateVimeoMedia(media, currentUser.UserID, youTubeData); new UserPersonalityMediaRepository().Create( new UserPersonalityMedia() { ID = Guid.NewGuid(), CategoryID = (byte)category, MediaID = media.ID, UserID = currentUserID }); return(media.Content); }
public ActionResult ChoosePersonalityMedia(PersonalityCategory category) { var model = new PersonalityMediaNewViewModel() { Category = category, Title = string.Format("{0} {1}", CfIdentity.DisplayName, category) }; if (category == PersonalityCategory.Avatar) { return(RedirectToAction("ChooseAvatar")); } else if (category == PersonalityCategory.Headshot) { return(RedirectToAction("ChooseHeadshot")); } else if (category == PersonalityCategory.Daredevil) { return(View(model)); } else if (category == PersonalityCategory.Funny) { return(View(model)); } else if (category == PersonalityCategory.Ready2Rock) { return(View(model)); } else if (category == PersonalityCategory.Scenic) { return(View(model)); } else if (category == PersonalityCategory.BestShot) { return(View(model)); } else if (category == PersonalityCategory.PartnerShot) { return(View(model)); } else { throw new ArgumentNullException(category + " not a valid personality media category"); } }
/// <summary> /// /// </summary> /// <param name="imgStream"></param> /// <returns></returns> public string SavePersonalityMediaImage(Guid userID, Stream imgStream, string name, PersonalityCategory category, ImageCropOpts cropOpts) { var media = new Media() { FeedVisible = true, Title = name, ContentType = "image/jpg" }; new MediaService().CreateImageMedia(media, userID, imgStream); new UserPersonalityMediaRepository().Create( new UserPersonalityMedia() { ID = Guid.NewGuid(), CategoryID = (byte)category, MediaID = media.ID, UserID = userID }); return(media.Content); }