Пример #1
0
 private void btnPlaceComment_Click(object sender, RoutedEventArgs e)
 {
     if (!txtComment.Text.Equals(""))
     {
         VideoComment vc = new VideoComment();
         vc.Comment = txtComment.Text;
         vc.VideoId = _vm.ActiveVideo.VideoId;
         vc.PlaceId = _vm.ActiveVideo.Place.PlaceId;
         vc.UserId = _vm.ActiveUser.UserId;
         _vm.SaveVideoComment(vc);
         txtComment.Text = "";
     }
 }
Пример #2
0
 //ADDVIDEOCOMMENT & LIST OF VIDEOCOMMENTS
 public async void AddVideoComment(VideoComment videocomment)
 {
     using (HttpClient client = new HttpClient())
     {
         try
         {
             string url = string.Format("{0}{1}", URL, "videocomment");
             string json = JsonConvert.SerializeObject(videocomment);
             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 VideoComment AddVieoComment(VideoComment videocomment)
 {
     videocomment = uow.VideoCommentRepository.AddVideoComment(videocomment);
     uow.Save();
     return videocomment;
 }
 public void SaveVideoComment(VideoComment videocomment)
 {
     shredderService.AddVideoComment(videocomment);
 }
 public VideoComment AddVideoComment(VideoComment videocomment)
 {
     return this.context.VideoComments.Add(videocomment);
 }