public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
        {
            try
            {
                var    xlUserName = context.User.Identity.Name;
                object p1         = context.Request["pageitemcount"];
                object p2         = context.Request["pageindex"];
                if (p1 == null || p2 == null)
                {
                    context.Response.Write("0param invalid");
                    return(null);
                }

                int pageitemcount = Convert.ToInt32(p1);
                int pageindex     = Convert.ToInt32(p2);

                MyGetNotFinishedSellStoneAsyncResult asyncResult = new MyGetNotFinishedSellStoneAsyncResult(context, cb, () =>
                {
                    if (string.IsNullOrEmpty(xlUserName))
                    {
                        throw new Exception("登录失败");
                    }
                    return(WcfClient.Instance.GetUserBuyStoneOrders(xlUserName, pageitemcount, pageindex));
                },
                                                                                                            xlUserName);
                asyncResult.StartWork();

                return(asyncResult);
            }
            catch (Exception exc)
            {
                LogHelper.Instance.AddErrorLog("AsyncGetBuyStoneRecordHandler.BeginProcessRequest Exception", exc);
                return(null);
            }
        }
Ejemplo n.º 2
0
        public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
        {
            try
            {
                context.Response.ContentType = "text/plain";
                context.Response.Cache.SetNoStore();
                var xlUserName = context.User.Identity.Name;
                MyGetNotFinishedSellStoneAsyncResult asyncResult = new MyGetNotFinishedSellStoneAsyncResult(context, cb, () =>
                {
                    if (string.IsNullOrEmpty(xlUserName))
                    {
                        throw new Exception("登录失败");
                    }
                    return(WcfClient.Instance.GetAllNotFinishedSellOrders(xlUserName));
                },
                                                                                                            xlUserName);
                asyncResult.StartWork();

                return(asyncResult);
            }
            catch (Exception exc)
            {
                LogHelper.Instance.AddErrorLog("AsyncGetSellStoneOrderHandler.BeginProcessRequest Exception", exc);
                return(null);
            }
        }