public ContentResult Search(SearchFilter SearchKey) { SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "Id" : SearchKey.OrderBy; ScheduleTaskCollection collection = ScheduleTaskManager.Search(SearchKey); return(Content(JsonConvert.SerializeObject(collection), "application/json")); }
/// <summary> /// use for scrolling page /// </summary> /// <returns></returns> public ContentResult GetPg(int page, int pagesize) { string condition = ""; SearchFilter SearchKey = SearchFilter.SearchPG(CurrentUser.CompanyID, page, pagesize, "Id", "Id", "Desc", condition); ScheduleTaskCollection objItem = ScheduleTaskManager.Search(SearchKey); return(Content(JsonConvert.SerializeObject(objItem), "application/json")); }
public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel) { SearchFilter SearchKey = SearchFilter.SearchData(CurrentUser.CompanyID, requestModel, "Id", "Id"); ScheduleTaskCollection collection = ScheduleTaskManager.Search(SearchKey); int TotalRecord = 0; if (collection.Count > 0) { TotalRecord = collection[0].TotalRecord; } //ScheduleTaskCollection data = ScheduleTaskManager.GetAll(CurrentUser.CompanyID); return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet)); }
public JsonResult GetSearchData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel, string searchprm) { SearchFilter SearchKey = BindSearch(searchprm); SearchKey = SearchFilter.SearchData(SearchKey, requestModel); ScheduleTaskCollection collection = ScheduleTaskManager.Search(SearchKey); int TotalRecord = 0; if (collection.Count > 0) { TotalRecord = collection[0].TotalRecord; } return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet)); }
// GET api/<controller> /// <summary> /// Gets this instance. /// </summary> /// <returns></returns> public ScheduleTaskCollection Post(string method, [FromBody] SearchFilter value) { return(ScheduleTaskManager.Search(value)); }