Exemplo n.º 1
0
        //购买记录
        private string InvestList(HttpContext context)
        {
            int pageSize = 10; //默认每页返回记录数
            int _pageindex;

            string userid    = context.Request["userid"] ?? "";
            string pageindex = context.Request["pageindex"] ?? ""; //页索引
            string findkey   = context.Request["findkey"] ?? "";   //搜索关键字

            string message = string.Empty;

            long _userid = 0;

            int.TryParse(pageindex, out _pageindex);

            if (_pageindex <= 0)
            {
                _pageindex = 1;
            }

            if (string.IsNullOrEmpty(userid))
            {
                return(ResultJson(ResultType.error, "请输入用户ID", ""));
            }
            if (!string.IsNullOrEmpty(findkey))
            {
                findkey = SafeHelper.GetSafeSql(findkey);
            }

            long.TryParse(userid, out _userid);
            InvestService svc    = new InvestService();
            var           result = svc.InvestList(_userid, _pageindex, pageSize, findkey);

            return(ResultJson(ResultType.success, message, result));
        }
Exemplo n.º 2
0
        private string GetAccountList(HttpContext context)
        {
            int pageSize = 10; //默认每页返回记录数
            int _pageindex;
            int _type;

            string userid    = context.Request["userid"] ?? "";
            string pageindex = context.Request["pageindex"] ?? ""; //页索引
            string findkey   = context.Request["findkey"] ?? "";   //搜索关键字
            string type      = context.Request["type"] ?? "";      //类型

            if (string.IsNullOrEmpty(userid))
            {
                return(ResultJson(ResultType.error, "请输入用户ID", ""));
            }
            if (string.IsNullOrEmpty(pageindex))
            {
                return(ResultJson(ResultType.error, "页索引不能为空", ""));
            }
            if (string.IsNullOrEmpty(type))
            {
                return(ResultJson(ResultType.error, "类型不能为空", ""));
            }
            int.TryParse(pageindex, out _pageindex);

            if (_pageindex <= 0)
            {
                _pageindex = 1;
            }

            long _userid = 0;

            long.TryParse(userid, out _userid);
            int.TryParse(type, out _type);

            if (!string.IsNullOrEmpty(findkey))
            {
                findkey = SafeHelper.GetSafeSql(findkey);
            }

            AccountService svc = new AccountService();
            object         result;

            if ("1".Equals(type))
            {
                result = svc.AccountList(_userid, _pageindex, pageSize, findkey, _type);
            }
            else
            {
                result = svc.AccountYTList(_userid, _pageindex, pageSize, findkey, _type);
            }
            return(ResultJson(ResultType.success, "获取成功", result));
        }
Exemplo n.º 3
0
        //激活列表
        private string ActiveList(HttpContext context)
        {
            int pageSize = 10; //默认每页返回记录数
            int _pageindex;

            string userid    = context.Request["userid"] ?? "";
            string pageindex = context.Request["pageindex"] ?? ""; //页索引
            string findkey   = context.Request["findkey"] ?? "";   //搜索关键字

            string message = string.Empty;

            long _userid = 0;

            _pageindex = pageindex.ToInt();
            if (_pageindex <= 0)
            {
                _pageindex = 1;
            }

            if (string.IsNullOrEmpty(userid))
            {
                return(ResultJson(ResultType.error, "请输入用户ID", ""));
            }
            if (!string.IsNullOrEmpty(findkey))
            {
                findkey = SafeHelper.GetSafeSql(findkey);
            }

            long.TryParse(userid, out _userid);
            InvestService svc    = new InvestService();
            var           result = svc.ActiveList(_userid, _pageindex, pageSize, findkey);
            var           info   = svc.GetInfo(_userid);

            Dictionary <string, object> dict = new Dictionary <string, object>();

            dict.Add("info", info);   //
            dict.Add("list", result); //

            return(ResultJson(ResultType.success, message, dict));
        }