protected override ActionResult DoTask(string data) { string delStrIds = Request.QueryString["id"]; string pageNoStr = Request.QueryString["PageN"]; int pageNo = 0; if (!int.TryParse(pageNoStr, out pageNo)) pageNo = 0; int userId = 0; if (!int.TryParse(data, out userId)) userId = 0; string[] delStrIdCol = delStrIds.Split(','); List<int> delIds = new List<int>(); foreach (string delStrId in delStrIdCol) { string tmpDelIdStr = (delStrId ?? string.Empty).Trim(); if (string.IsNullOrEmpty(tmpDelIdStr)) continue; else { int tmpDelId = 0; if (int.TryParse(tmpDelIdStr, out tmpDelId)) delIds.Add(tmpDelId); else continue; } } HistoryCollection collection = new HistoryCollection(); collection.DeleteByHistoryIds(delIds.ToArray()); collection.PageSize = 6; collection.FillByUserId(userId); if (pageNo > collection.PageCount) pageNo = collection.PageCount; collection.AbsolutePage = pageNo; collection.IsReturnDataTable = true; collection.FillByUserId(userId); ActionResult result = new ActionResult(); StringBuilder response = new StringBuilder(); response.Append(ActionTaskUtility.ReturnClientDataArray(collection.GetFillDataTable())); response.Append(string.Format("TmpStr={0};", collection.PageCount)); result.IsSuccess = true; result.ResponseData = response.ToString(); return result; }
protected override ActionResult DoTask(string data) { string pageNoStr = Request.QueryString["pagenum"]; int pageNo = 0; if (!int.TryParse(pageNoStr, out pageNo)) pageNo = 0; int userId = 0; if (!int.TryParse(data, out userId)) userId = 0; HistoryCollection collection = new HistoryCollection(); if (pageNo == 0) { collection.PageSize = 0; collection.IsReturnDataTable = true; collection.FillByUserId(userId); } else { collection.PageSize = 6; collection.FillByUserId(userId); if (pageNo > collection.PageCount) pageNo = collection.PageCount; collection.AbsolutePage = pageNo; collection.IsReturnDataTable = true; collection.FillByUserId(userId); } ActionResult result = new ActionResult(); StringBuilder response = new StringBuilder(); response.Append(ActionTaskUtility.ReturnClientDataArray(collection.GetFillDataTable())); response.Append(string.Format("TmpStr={0};", collection.PageCount)); result.IsSuccess = true; result.ResponseData = response.ToString(); return result; }
protected void Page_Load(object sender, EventArgs e) { collection = new HistoryCollection(); collection.PageSize = 10; collection.AbsolutePage = 1; collection.FillByUserId(this.CurrentUserId); this.repHistoryList.DataSource = collection; this.repHistoryList.DataBind(); }