예제 #1
0
            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;
            }
예제 #2
0
            protected override ActionResult DoTask(string data)
            {
                string sign = Request.QueryString["sign"];
                string condition = PageHistoryTaskUtility.ParseExpVal(sign, data);

                HistoryCollection collection = new HistoryCollection();
                collection.PageSize = 10;
                collection.AbsolutePage = 1;
                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;
            }
예제 #3
0
            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;
            }
예제 #4
0
            protected override ActionResult DoTask(string data)
            {
                string pageNoStr = Request.QueryString["pagenum"];
                int pageNo = 0;
                if (!int.TryParse(pageNoStr, out pageNo))
                    pageNo = 0;

                string condition = PageHistoryTaskUtility.ParseExpVal("0", "");
                HistoryCollection historyCollection = new HistoryCollection();
                if (pageNo == 0)
                {
                    historyCollection.PageSize = 0;
                    historyCollection.IsReturnDataTable = true;
                    historyCollection.FillByCondition(condition);
                }
                else
                {
                    historyCollection.PageSize = 10;
                    historyCollection.FillByCondition(condition);
                    if (pageNo > historyCollection.PageCount)
                        pageNo = historyCollection.PageCount;
                    historyCollection.AbsolutePage = pageNo;
                    historyCollection.IsReturnDataTable = true;
                    historyCollection.FillByCondition(condition);
                }
                ActionResult result = new ActionResult();
                StringBuilder response = new StringBuilder();
                response.Append(ActionTaskUtility.ReturnClientDataArray(historyCollection.GetFillDataTable()));
                response.Append(string.Format("TmpStr={0};", historyCollection.PageCount));
                result.IsSuccess = true;
                result.ResponseData = response.ToString();
                return result;
            }