public async Task <ActionResult> getinfo() { var json = new StreamReader(Request.Body).ReadToEnd(); var data = JsonConvert.DeserializeObject <List <RoleObject> >(json); var _posts = await RoleObjectBLL.LoadItems(_context, data[0]); return(Ok(new { posts = _posts[0] })); }
public ActionResult action() { var json = new StreamReader(Request.Body).ReadToEnd(); var data = JsonConvert.DeserializeObject <List <RoleObject> >(json); RoleObjectBLL.ProcessAction(_context, data); return(Ok(new { status = "success", message = SiteConfig.generalLocalizer["_records_processed"].Value })); }
public async Task <ActionResult> proc() { var json = new StreamReader(Request.Body).ReadToEnd(); var item = JsonConvert.DeserializeObject <JGN_RoleObjects>(json); if (item.id > 0) { await RoleObjectBLL.Update_Record(_context, item); } else { item = await RoleObjectBLL.Add(_context, item); } return(Ok(new { status = "success", record = item, message = SiteConfig.generalLocalizer["_records_processed"].Value })); }
public async Task <ActionResult> load() { var entity = new RoleObject() { order = "id desc", pagesize = 4000, pagenumber = 1 }; var _posts = await RoleObjectBLL.LoadItems(_context, entity); var _records = 0; if (entity.id == 0) { _records = await RoleObjectBLL.Count(_context, entity); } return(Ok(new { posts = _posts, records = _records })); }