public ContentResult Search(SearchFilter SearchKey)
        {
            SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "Id" : SearchKey.OrderBy;
            T_LMS_Trans_LeaveStoryCollection collection = T_LMS_Trans_LeaveStoryManager.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(1, page, pagesize, "Id", "Id", "Desc", condition);
            T_LMS_Trans_LeaveStoryCollection objItem = T_LMS_Trans_LeaveStoryManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
        public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel)
        {
            SearchFilter SearchKey = SearchFilter.SearchData(1, requestModel, "Id", "Id");
            T_LMS_Trans_LeaveStoryCollection collection = T_LMS_Trans_LeaveStoryManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_LMS_Trans_LeaveStoryCollection Post(string method, [FromBody] SearchFilter value)
 {
     return(T_LMS_Trans_LeaveStoryManager.Search(value));
 }