public HttpResponseMessage UpdateComment(Data.NoteComment value) { Data.NoteCommentData db = new Data.NoteCommentData(); string version = value.Version; try { db.Update(value, decimal.Parse(value.Version)); } catch (Exception ex) { HttpError error = new HttpError("UpdateComment: " + ex.Message); return(this.Request.CreateErrorResponse( HttpStatusCode.BadRequest, error)); } HttpResponseMessage msg = new HttpResponseMessage(); msg.ReasonPhrase = "Comment updated."; return(this.Request.CreateResponse( HttpStatusCode.OK, msg)); }
public string AddComment(Data.NoteComment value) { try { string version = value.Version; Data.NoteCommentData db = new Data.NoteCommentData(); string ckey = db.Add(value); return(ckey); } catch (Exception ex) { var resp = new HttpResponseMessage(HttpStatusCode.ExpectationFailed) { ReasonPhrase = ex.Message }; throw new HttpResponseException(resp); } }