protected override ActionResult DoTask(string data) { int pageNo = Convert.ToInt32(Request.QueryString["PageN"]); string linkStrIds = Request.QueryString["linkid"]; int[] linkIds = StringUtility.SplitStringToIntArray(linkStrIds, ","); if (linkIds == null || linkIds.Length == 0) linkIds = new int[] { -1 }; string quesStrIds = Request.QueryString["quesid"]; int[] quesIds = StringUtility.SplitStringToIntArray(quesStrIds, ","); if (quesIds == null || quesIds.Length == 0) quesIds = new int[] { -1 }; QuestionCollection collection = new QuestionCollection(); collection.DeleteByQuestionIds(quesIds); collection.DeleteByLinkIds(linkIds); string condition = PageQuestionTaskUtility.CurrentExpVal(); if (pageNo == 0) { collection.PageSize = 0; collection.IsReturnDataTable = true; collection.FillByCondition(condition); } else { collection.PageSize = 8; collection.FillByCondition(condition); if (pageNo > collection.PageCount) pageNo = collection.PageCount; collection.AbsolutePage = pageNo; collection.IsReturnDataTable = true; collection.FillByCondition(condition); } 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) { int pageNo = Convert.ToInt32(Request.QueryString["pagenum"]); int linkId = Convert.ToInt32(Request.QueryString["subid"]); string delStrIds = Request.QueryString["ids"]; 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; } } QuestionCollection collection = new QuestionCollection(); collection.DeleteByQuestionIds(delIds.ToArray()); collection.PageSize = 4; collection.FillByLinkId(linkId); if (pageNo > collection.PageCount) pageNo = collection.PageCount; collection.AbsolutePage = pageNo; collection.IsReturnDataTable = true; collection.FillByLinkId(linkId); 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; }