public async Task <IActionResult> GetProjectFormListData(int formID, int projectID, string sidx, string sord, int page = 1, int rows = 10) { var jsonData = new { total = 0, page, records = 0, rows = new List <ProjectSubmitedFormListModal>() }; try { List <SubmittedFormBE> list = FormLogic.BlockFetchSubmittedForm(page, rows, out int totalRecords, projectID, formID); if (list == null) { return(Json(jsonData)); } else { var resultFormTemplate = (from obj in list select new ProjectSubmitedFormListModal { Surrogate = obj.ReferenceNumber.ToString(), FormSurrogate = obj.FormId.ToString(), Design = obj.GetCustomDataValue <string>("Design"), Description = obj.GetCustomDataValue <string>("DesignDescription"), FormStatus = obj.Status.ToString(), CreationDate = obj.CreatedDateTime.ToString() }).ToList(); var totalPages = (int)Math.Ceiling((float)totalRecords / (float)rows); jsonData = new { total = totalPages, page, records = totalRecords, rows = resultFormTemplate }; } var jsonResult = Json(jsonData); return(jsonResult); } catch (Exception ex) { return(Json(jsonData)); } }