public JsonResult GetAllCategory(jQueryDataTableParamModel param)
        {
            try
            {
                var allRecords = new List <Category>();
                allRecords = MS.GetAllCategory();
                List <Category> filteredRecords = null;

                if (!string.IsNullOrWhiteSpace(param.sSearch))
                {
                    allRecords      = allRecords.Where(t => t.Id.ToString().Contains(param.sSearch.ToLower()) || t.Name.ToLower().ToString().Contains(param.sSearch.ToLower()) || t.IsActive.ToString().ToLower().Contains(param.sSearch.ToLower())).OrderBy(t => t.Name).ToList();
                    filteredRecords = allRecords.Skip(param.iDisplayStart).Take(param.iDisplayLength).ToList();
                }
                else
                {
                    filteredRecords = allRecords
                                      .Skip(param.iDisplayStart)
                                      .Take(param.iDisplayLength).OrderBy(t => t.Name).ToList();
                }
                int totalRecords = allRecords.Count();
                var result       = from c in filteredRecords select new[] { "", c.Id.ToString(), c.Name, c.IsActive == true ? "Active" : "InActive", "" };
                return(Json(new
                {
                    sEcho = param.sEcho,
                    iTotalRecords = totalRecords,
                    iTotalDisplayRecords = totalRecords,
                    aaData = result
                }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                CommonServices.ErrorLogging(ex);
                return(Json(new
                {
                    sEcho = 1,
                    iTotalRecords = 0,
                    iTotalDisplayRecords = 0,
                    aaData = new List <string[]> {
                    }
                }, JsonRequestBehavior.AllowGet));
            }
        }