public JsonResult deletePostRecord(int postRecordId) { Response response = new Response(); PostRecordDataHandler postRecordDataHandler = new PostRecordDataHandler(config); response.status = postRecordDataHandler.deletePostRecord(postRecordId); return(Json(response)); }
public JsonResult createPostRecord([FromBody] PostRecord postRecord) { Response response = new Response(); PostRecordDataHandler postRecordDataHandler = new PostRecordDataHandler(config); postRecordDataHandler.postId = postRecord.postId; postRecordDataHandler.postRecordId = postRecord.postRecordId; postRecordDataHandler.userId = postRecord.userId; postRecordDataHandler.datePosted = postRecord.datePosted; response.status = postRecordDataHandler.createPostRecord(); return(Json(response)); }
public JsonResult getAllPostRecords(int userId) { Response response = new Response(); PostRecordDataHandler postRecordDataHandler = new PostRecordDataHandler(config); try { List <PostRecord> postRecords = postRecordDataHandler.getAllPostRecords(userId); response.data = JsonConvert.SerializeObject(postRecords); response.status = true; } catch (Exception ex) { response.status = false; response.message = ex.Message; } return(Json(response)); }