public GetPicture GetReviewById(GetPictureId input) { var getPicture = _pictureManager.GetPictureById(input.Id); GetPicture output = Mapper.Map <Picture, GetPicture>(getPicture); return(output); }
public object Get(GetPicture request) { try { var picture = Db.GetByIdOrDefault<Picture>(request.Id); if (picture == null) return HttpError.NotFound("Picture with this id is not found"); var gal = Db.GetByIdOrDefault<Gallery>(picture.GalleryId); var pictureDto = Mapper.Map<PictureExtendedDTO>(picture); pictureDto.Material = Db.GetByIdOrDefault<Material>(picture.MaterialId)?.Name; pictureDto.Gallery = gal != null ? $"{gal.Name}, {gal.City}" : null; pictureDto.Technique = Db.GetByIdOrDefault<Technique>(picture.TechniqueId)?.Name; pictureDto.Image = new UriBuilder(Request.AbsoluteUri) {Path = $"img/{picture.Id}.jpg"}.Uri.AbsoluteUri; pictureDto.Artists = Db.Select<PicturesByArtist>(x => x.PictureId == picture.Id) .Join(Db.Select<Artist>(), pb => pb.ArtistId, a => a.Id, (_, a) => new CustomEntity {Id = a.Id}).ToArray(); pictureDto.Genres = Db.Select<PicturesByGenre>(x => x.PictureId == picture.Id) .Join(Db.Select<Genre>(), pb => pb.GenreId, g => g.Id, (_, g) => g.Name).ToArray(); return new HttpResult(pictureDto, $"{MimeTypes.Json}; charset=utf-8"); } catch { return new HttpError(InternalServerError, "Internal Server Error"); } }
private void btnLoad_Click(object sender, EventArgs e) { GetPicture picture = new GetPicture(); if (picture.getPicture() != null) { productPicture.Image = picture.getPicture(); } }
private void btnLoad_Click(object sender, EventArgs e) { GetPicture picture = new GetPicture(); if (picture.getPicture() != null) { pictureItem.Image = picture.getPicture(); } admin.editPicture(pictureId, pictureItem.Image); this.Close(); }
// 찍은 사진을 Panel에 보여준다. void GetPirctureAndShowIt() { string pathToFile = GetPicture.GetLastPicturePath(); if (pathToFile == null) { return; } Texture2D texture = GetScreenshotImage(pathToFile); Sprite sp = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f)); panel.SetActive(true); shareButtons.SetActive(true); panel.GetComponent <Image>().sprite = sp; }
bool firstCount; // 첫번째 실행인지 체크하기 위한 변수 public void Share_Button() { if (!firstCount) { GameCenterManager.Instance.SuccessDeviceAchievement(GameCenterManager.MyAchievement.ShareYourLight); firstCount = true; } // 공유버튼 사라짐 ShareButtons.SetActive(false); new NativeShare().AddFile(GetPicture.GetLastPicturePath()).SetSubject("Shine Bright") .SetText("Now Playing♪: " + AudioManager.Instance.audios[0].clip.name + ", \n" + "Download Link: https://play.google.com/store/apps/details?id=com.TeamSalmon.ShineBright \n" + " #ShineBright").Share(); }
public void LoginCompleteWithCompose(TwitterSession session) { if (LanguageManager.nowLoc == Location.Korean) { frontStr = "Download: "; } else if (LanguageManager.nowLoc == Location.Japanese) { frontStr = "Download: "; } else { frontStr = "Download: "; } string imageUri = "file://" + GetPicture.GetLastPicturePath(); Twitter.Compose(session, imageUri, frontStr, new string[] { hashtagStr }, (string tweetId) => { UnityEngine.Debug.Log("Tweet Success, tweetId=" + tweetId); }, (ApiError error) => { UnityEngine.Debug.Log("Tweet Failed " + error.message); }, () => { Debug.Log("Compose cancelled"); } ); }