public HttpResponseMessage Put(int id, [FromBody] Note value) { NotePercistance pp = new NotePercistance(); bool recordExisted = false; recordExisted = pp.updateNote(id, value); HttpResponseMessage response; if (recordExisted) { response = Request.CreateResponse(HttpStatusCode.NoContent); } else { response = Request.CreateResponse(HttpStatusCode.NotFound); } return(response); }
public HttpResponseMessage Delete(int id) { NotePercistance note = new NotePercistance(); bool recordExsisted = false; recordExsisted = note.deleteNote(id); HttpResponseMessage response; if (recordExsisted) { response = Request.CreateResponse(HttpStatusCode.NoContent); } else { response = Request.CreateResponse(HttpStatusCode.NotFound); } return(response); }
public HttpResponseMessage Post([FromBody] Note value) { bool recordExsisted = false; NotePercistance note = new NotePercistance(); recordExsisted = note.saveNote(value); HttpResponseMessage response; if (recordExsisted) { response = Request.CreateResponse(HttpStatusCode.Found); } else { response = Request.CreateResponse(HttpStatusCode.Created); } return(response); }
public ArrayList Get(String username) { NotePercistance note = new NotePercistance(); return(note.getNotebyId(username)); }
public ArrayList Get() { NotePercistance note = new NotePercistance(); return(note.getNote()); }