public JsonResult GetTimesheetReport() { int start = Convert.ToInt32(Request["start"]); int length = Convert.ToInt32(Request["length"]); int totalRow = 0; TimesheetReportSearch search = new TimesheetReportSearch(); search.isPage = true; search.pageStart = Convert.ToInt32(Request["start"]); search.pageSize = Convert.ToInt32(Request["length"]); search.startDate = string.IsNullOrEmpty(Request["columns[0][search][value]"]) ? DateTime.Parse(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")) : DateTime.Parse(Request["columns[0][search][value]"]); search.endDate = string.IsNullOrEmpty(Request["columns[1][search][value]"]) ? DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) : DateTime.Parse(Request["columns[1][search][value]"]); if (!string.IsNullOrEmpty(Request["columns[2][search][value]"])) { search.departmentIds = Request["columns[2][search][value]"]; } if (!string.IsNullOrEmpty(Request["columns[3][search][value]"])) { search.productionLineList = Request["columns[3][search][value]"]; } if (!string.IsNullOrEmpty(Request["columns[4][search][value]"])) { search.projectIds = Request["columns[4][search][value]"]; } if (!string.IsNullOrEmpty(Request["columns[5][search][value]"])) { search.userIds = Request["columns[5][search][value]"]; } if (!string.IsNullOrEmpty(Request["columns[6][search][value]"])) { search.status = Request["columns[6][search][value]"]; } search.currentUserID = Common.CommonHelper.CurrentUser; DataTable dt = _reportAppService.GetTimesheetReport(search, out totalRow); return(Json(new { data = GetListByDataTable(dt), draw = Request["draw"], recordsTotal = totalRow, recordsFiltered = totalRow }, JsonRequestBehavior.AllowGet)); }