コード例 #1
0
            protected override ActionResult DoTask(string data)
            {
                int pageNo = Convert.ToInt32(Request.QueryString["pagenum"]);
                int linkId = Convert.ToInt32(Request.QueryString["subid"]);

                QuestionCollection collection = new QuestionCollection();
                if (pageNo == 0)
                {
                    collection.PageSize = 0;
                    collection.IsReturnDataTable = true;
                    collection.FillByLinkId(linkId);
                }
                else
                {
                    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(), this.IsOtherRequest));
                if (this.IsOtherRequest)
                    response.Append(string.Format("STmpStr={0};", collection.PageCount));
                else
                    response.Append(string.Format("TmpStr={0};", collection.PageCount));

                result.IsSuccess = true;
                result.ResponseData = response.ToString();
                return result;
            }
コード例 #2
0
            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;
            }