Example #1
0
 public ResultModel Put(int id, [FromBody] Post post)
 {
     try
     {
         _postBLL.EditPost(id, post);
         return(new ResultModel(Code.OK, "thành công"));
     }
     catch (Exception ex)
     {
         if (ex.Message.Contains("Mã bài viết đã tồn tại"))
         {
             return(new ResultModel(Code.SVERROR, ex.Message.ToString()));
         }
         else
         {
             return(new ResultModel(Code.SVERROR, "lỗi hệ thống"));
         }
     }
 }
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     _postBLL.EditPost(Text.Text, _postId);
     this.Close();
 }