Exemplo n.º 1
0
 private void btnPlaceComment_Click(object sender, RoutedEventArgs e)
 {
     if (!txtComment.Text.Equals(""))
     {
         PlaceComment pc = new PlaceComment();
         pc.Comment = txtComment.Text;
         pc.PlaceId = _vm.ActivePlace.PlaceId;
         pc.UserId = _vm.ActiveUser.UserId;
         _vm.SavePlaceComment(pc);
         txtComment.Text = "";
     }
 }
Exemplo n.º 2
0
 //ADDPLACECOMMENT & LIST OF PLACECOMMENTS
 public async void AddPlaceComment(PlaceComment placecomment)
 {
     using (HttpClient client = new HttpClient())
     {
         try
         {
             string url = string.Format("{0}{1}", URL, "placecomment");
             string json = JsonConvert.SerializeObject(placecomment);
             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 SavePlaceComment(PlaceComment placecomment)
 {
     shredderService.AddPlaceComment(placecomment);
 }
 public PlaceComment AddPlaceComment(PlaceComment placecomment)
 {
     placecomment = uow.PlaceCommentRepository.AddPlaceComment(placecomment);
     uow.Save();
     return placecomment;
 }
 public PlaceComment AddPlaceComment(PlaceComment placecomment)
 {
     return this.context.PlaceComments.Add(placecomment);
 }