private void btnPlaceComment_Click(object sender, RoutedEventArgs e)
 {
     if (!txtComment.Text.Equals(""))
     {
         PictureComment pc = new PictureComment();
         pc.Comment = txtComment.Text;
         pc.PictureId = _vm.ActivePicture.PictureId;
         pc.PlaceId = _vm.ActivePicture.Place.PlaceId;
         pc.UserId = _vm.ActiveUser.UserId;
         _vm.SavePictureComment(pc);
         txtComment.Text = "";
     }
 }
 public PictureComment AddPictureComment(PictureComment picturecomment)
 {
     picturecomment = uow.PictureCommentRepository.AddPictureComment(picturecomment);
     uow.Save();
     return picturecomment;
 }
Esempio n. 3
0
 //ADDPICTURECOMMENT & LIST OF PICTURECOMMENTS
 public async void AddPictureComment(PictureComment picturecomment)
 {
     using (HttpClient client = new HttpClient())
     {
         try
         {
             string url = string.Format("{0}{1}", URL, "picturecomment");
             string json = JsonConvert.SerializeObject(picturecomment);
             HttpContent content = new StringContent(json);
             content.Headers.Clear();
             content.Headers.Add("Content-Type", "application/json");
             await client.PostAsync(url, content);
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }
 public void SavePictureComment(PictureComment picturecomment)
 {
     shredderService.AddPictureComment(picturecomment);
 }
 public PictureComment AddPictureComment(PictureComment picturecomment)
 {
     return this.context.PictureComments.Add(picturecomment);
 }