//添加钱包地址
        private string AddBagAddress(HttpContext context)
        {
            string userid      = context.Request["userid"] ?? "";
            string accountname = context.Request["accountname"] ?? "";
            string accounts    = context.Request["accounts"] ?? "";

            string defaults = context.Request["defaults"] ?? "";

            string strpaypwd = context.Request["paypwd"] ?? "";
            string fromwhere = context.Request["fromwhere"] ?? "";
            string message   = string.Empty;
            int    _userid   = userid.ToInt();

            BankAcountService svc = new BankAcountService();

            var result = svc.BagAddress(_userid, accountname, accounts, defaults, strpaypwd, fromwhere, out message);

            if (result)
            {
                if (fromwhere == "pc")
                {
                    List <BankModel> list = svc.BankList(_userid);
                    return(ResultJson(ResultType.success, "绑定成功", list));
                }
                else
                {
                    return(ResultJson(ResultType.success, "绑定成功", ""));
                }
            }
            else
            {
                return(ResultJson(ResultType.error, "绑定失败", ""));
            }
        }
        //添加银行
        private string AddBank(HttpContext context)
        {
            string userid      = context.Request["userid"] ?? "";
            string bankname    = context.Request["bankname"] ?? "";
            string bankaccount = context.Request["bankaccount"] ?? "";
            string bankuser    = context.Request["bankuser"] ?? "";
            string defaults    = context.Request["defaults"] ?? "";

            string strpaypwd = context.Request["paypwd"] ?? "";
            string fromwhere = context.Request["fromwhere"] ?? "";
            string message   = string.Empty;
            long   _userid   = 0;

            if (string.IsNullOrEmpty(bankname))
            {
                return(ResultJson(ResultType.error, "请输入银行卡名称", ""));
            }
            if (string.IsNullOrEmpty(bankaccount))
            {
                return(ResultJson(ResultType.error, "请输入银行账号", ""));
            }
            if (string.IsNullOrEmpty(bankuser))
            {
                return(ResultJson(ResultType.error, "请输入持卡人姓名", ""));
            }
            if (defaults == "")
            {
                defaults = "0";
            }

            //LogHelper.SaveLog(string.Format("userid:{0},bankname{1},bankaccount:{2},bankuser:{3},defaults:{4}", userid, bankname, bankaccount, bankuser, defaults),"debug_Addbank");

            long.TryParse(userid, out _userid);
            BankAcountService svc = new BankAcountService();
            var result            = svc.Bank(_userid, bankname, bankaccount, bankuser, defaults, strpaypwd, fromwhere, out message);

            if (result)
            {
                if (fromwhere == "pc")
                {
                    List <BankModel> list = svc.BankList(_userid).OrderByDescending(b => b.BankID).ToList();
                    return(ResultJson(ResultType.success, "添加成功", list));
                }
                else
                {
                    return(ResultJson(ResultType.success, "添加成功", ""));
                }
            }
            else
            {
                return(ResultJson(ResultType.error, message, ""));
            }
        }
        //银行卡列表
        private string BankLists(HttpContext context)
        {
            string userid  = context.Request["userid"] ?? "";
            string message = string.Empty;
            long   _userid = 0;

            long.TryParse(userid, out _userid);
            BankAcountService svc  = new BankAcountService();
            List <BankModel>  list = svc.BankList(_userid);

            return(ResultJson(ResultType.success, message, list));
        }
        //绑定微信,支付宝
        private string PayWeChat(HttpContext context)
        {
            string userid   = context.Request["userid"] ?? "";
            string nickname = context.Request["nickname"] ?? "";
            string accounts = context.Request["accounts"] ?? "";
            string type     = context.Request["type"] ?? "";
            string defaults = context.Request["defaults"] ?? "";

            string strpaypwd = context.Request["paypwd"] ?? "";
            string fromwhere = context.Request["fromwhere"] ?? "";
            string message   = string.Empty;
            int    _userid   = 0;

            if (string.IsNullOrEmpty(type))
            {
                return(ResultJson(ResultType.error, "请输入绑定类型", ""));
            }
            if (!(type == "2" || type == "3"))
            {
                return(ResultJson(ResultType.error, "绑定类型错误", ""));
            }

            int.TryParse(userid, out _userid);
            string path;

            upload(context, "bank", out path);

            BankAcountService svc = new BankAcountService();

            var result = svc.AlipayWeixin(_userid, nickname, accounts, type, defaults, path, strpaypwd, fromwhere, out message);

            if (result)
            {
                if (fromwhere == "pc")
                {
                    List <BankModel> list = svc.BankList(_userid);
                    return(ResultJson(ResultType.success, "绑定成功", list));
                }
                else
                {
                    return(ResultJson(ResultType.success, "绑定成功", ""));
                }
            }
            else
            {
                return(ResultJson(ResultType.error, "绑定失败", ""));
            }
        }