/// <summary> /// 获取图书内容统计 /// </summary> /// <returns></returns> public void GetBookContentCountData(HttpContext context) { int pageIndex = ConvertHelper.ToInt32(context.Request["pageIndex"]); int pageSize = ConvertHelper.ToInt32(context.Request["pageSize"]); int pressId = ConvertHelper.ToInt32(context.Request["pressId"]); string bookGuid = context.Request["bookGuid"]; string startDate = context.Request["startDate"]; string endDate = context.Request["endDate"]; if (string.IsNullOrEmpty(startDate)) { startDate = DateTime.Now.AddDays(-7).ToShortDateString(); } if (string.IsNullOrEmpty(endDate)) { endDate = DateTime.Now.ToShortDateString(); } int recordCount = 0; BookCountAccess data = new BookCountAccess(); DataTable dt = data.GetBookContentCountData(pageIndex, pageSize, pressId, bookGuid, startDate, endDate, new BasePage.BasePage().userId, ref recordCount); BaseResponse result = new BaseResponse(); result.list = dt; result.recordCount = recordCount; string strJson = JsonConvert.SerializeObject(result); context.Response.Write(strJson); }
private void BindData(int pageIndex) { int pressID = ConvertHelper.ToInt32(hidPressID.Value); string bookGuID = txtBookGuidLink.Value; string timestart = textTimeStart.Text; string timeend = textTimeEnd.Text; if (string.IsNullOrEmpty(timestart)) { timestart = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"); textTimeStart.Text = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"); } if (string.IsNullOrEmpty(timeend)) { timeend = DateTime.Now.ToString("yyyy-MM-dd"); textTimeEnd.Text = DateTime.Now.ToString("yyyy-MM-dd"); } if (pageIndex <= 0) { pageIndex = 1; } int recordCount = 0; BookCountAccess data = new BookCountAccess(); DataTable dt = data.GetBookContentCountData(pageIndex, 10, pressID, bookGuID, timestart, timeend, userId, ref recordCount); num.Value = recordCount.ToString(); AspNetPager1.CurrentPageIndex = pageIndex; AspNetPager1.RecordCount = recordCount; AspNetPager1.DataBind(); }