Пример #1
0
        //获取每种商品每天的个人的最大兑换数量
        private void GetLimitNum(Guid id)
        {
            string sql   = " select @LimitNum=LimitNum from dbo.MVipProductConfigure where IsLimitNum=1 and ProductId=@productId ";
            var    param = new Dapper.DynamicParameters();

            param.Add("@LimitNum", 0, DbType.Int32, ParameterDirection.Output);
            param.Add("@productId", id);
            TuanDai.DB.TuanDaiDB.Execute(TdConfig.ApplicationName, TdConfig.DBVipWrite, sql, ref param);
            LimitNum = param.Get <int?>("@LimitNum").HasValue ? param.Get <int>("@LimitNum") : 0;
        }
Пример #2
0
        //获取每种商品每天的个人的最大兑换数量
        private void GetLimitNum()
        {
            string id    = Context.Request.QueryString["id"];
            string sql   = " select @LimitNum=LimitNum,@IsLimitNum=IsLimitNum,@LeastLevel=LeastLevel,@IsLeastLevel=IsLeastLevel from dbo.MVipProductConfigure where ProductId=@productId ";
            var    param = new Dapper.DynamicParameters();

            param.Add("@LimitNum", 0, DbType.Int32, ParameterDirection.Output);
            param.Add("@IsLimitNum", 0, DbType.Boolean, ParameterDirection.Output);
            param.Add("@LeastLevel", 0, DbType.Int32, ParameterDirection.Output);
            param.Add("@IsLeastLevel", 0, DbType.Boolean, ParameterDirection.Output);
            param.Add("@productId", id);
            TuanDai.DB.TuanDaiDB.Execute(TdConfig.ApplicationName, TdConfig.DBVipWrite, sql, ref param);
            bool isLimitNum = param.Get <bool?>("@IsLimitNum").HasValue ? param.Get <bool>("@IsLimitNum") : false;

            if (isLimitNum)
            {
                LimitNum = param.Get <int?>("@LimitNum").HasValue ? param.Get <int>("@LimitNum") : 0;
            }
            bool isLeastLevel = param.Get <bool?>("@IsLeastLevel").HasValue ? param.Get <bool>("@IsLeastLevel") : false;

            if (isLeastLevel)
            {
                LeastLevel = param.Get <int?>("@LeastLevel").HasValue ? param.Get <int>("@LeastLevel") : 1;
            }
        }
Пример #3
0
        protected string WeDeadlines = string.Empty; //we计划月份
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                Guid UserId = WebUserAuth.UserId.Value;
                var  para   = new Dapper.DynamicParameters();
                para.Add("@UserId", UserId);
                para.Add("@rank", 0, DbType.Int32, ParameterDirection.Output);
                TuanDai.DB.TuanDaiDB.Execute(TdConfig.ApplicationName, TdConfig.DBRead, "exec p_GetUserAutoQueue @UserId,@rank out", ref para);
                rankid = para.Get <int?>("@rank") ?? 0;

                //List<UserAutoTenderSettingInfo> list =
                //    new UserAutoTenderSettingBLL().GetUserAutoTenderSettingListByUserId(UserId);
                //autoList = list.ToList();

                string sql         = @"SELECT * FROM (SELECT * FROM dbo.UserAutoTenderSetting WITH(NOLOCK) WHERE UserId=@UserId
UNION 
SELECT Id,UserId,ProjectType,''AS RepaymentType,0 AS StartRate,0 AS EndRate,0 AS StartDeadLine,0 AS EndDeadLine,StartDate,EndDate,ReservedAmout,0 AS PreAmout,SortOrder,Status,CreateDate,0 AS StartDeadType,0 AS EndDeadType FROM dbo.UserAutoWePlanSetting WITH(NOLOCK) WHERE UserId=@UserId)a ORDER BY a.SortOrder";
                var    settingList = TuanDai.DB.TuanDaiDB.Query <UserAutoTenderSettingInfo>(TdConfig.ApplicationName,
                                                                                            TdConfig.DBRealRead, sql, ref para);
                autoList = settingList;
                //获取自动投标设置
                WebSettingInfo webSettingInfo =
                    new WebSettingBLL().GetWebSettingInfo("17191362-568A-4F46-8D7D-5C23D80C9D8B");
                this.perAmountLimit = !string.IsNullOrEmpty(webSettingInfo.Param2Value) ? webSettingInfo.Param2Value : "100";
                this.limitPercent   = !string.IsNullOrEmpty(webSettingInfo.Param3Value) ? webSettingInfo.Param3Value : "100";
            }
        }
Пример #4
0
        //获取复投宝的待收本息
        public Tuple <decimal, decimal> GetFTBDueInAmountInterest(Guid userId)
        {
            var dyParams = new Dapper.DynamicParameters();

            dyParams.Add("@UserId", userId);
            dyParams.Add("@totalAmount", 0, DbType.Decimal, ParameterDirection.Output, 18, null, 2);
            dyParams.Add("@totalInterest", 0, DbType.Decimal, ParameterDirection.Output, 18, null, 2);

            string strSQL = "select @totalAmount=RecoverBorrowOut, @totalInterest=DueComeInterest from We_FundAccountInfo where UserId=@UserId";

            PublicConn.ExecuteTD(PublicConn.DBWriteType.Read, strSQL, ref dyParams);
            Tuple <decimal, decimal> result = new Tuple <decimal, decimal>(dyParams.Get <decimal?>("@totalAmount") ?? 0, dyParams.Get <decimal?>("@totalInterest") ?? 0);

            return(result);
        }
Пример #5
0
        private void GetData()
        {
            Guid?      userId = WebUserAuth.UserId;
            WeOrderBLL webll  = new WeOrderBLL();

            model = webll.GetMyInvestWeFQBBaseDetail(userId.Value, weOrderId.Value);

            feeInfo        = new WeFTBRansomInfo();
            feeInfo.result = 0;

            var param = new Dapper.DynamicParameters();

            param.Add("@OrderId", weOrderId);
            param.Add("@ApplyAmount", model.AmountInvestment);
            param.Add("@ExitRate", 0, System.Data.DbType.Decimal, System.Data.ParameterDirection.Output, 18, null, 2);
            param.Add("@RewardRate", 0, System.Data.DbType.Decimal, System.Data.ParameterDirection.Output, 18, null, 2);
            param.Add("@HoldMonth", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
            param.Add("@HoldDay", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
            param.Add("@DueInAmount", 0, System.Data.DbType.Decimal, System.Data.ParameterDirection.Output, 18, null, 2);
            param.Add("@OutStatus", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
            param.Add("@ErrorMsg", 0, System.Data.DbType.String, System.Data.ParameterDirection.Output, 100);

            int outStatus = 0;

            TuanDai.DB.TuanDaiDB.Execute(TdConfig.ApplicationName, TdConfig.DBSubscribeWrite, "P_WeFTBAdvanceManageFee", ref param, CommandType.StoredProcedure);
            outStatus = param.Get <int>("@OutStatus");
            if (outStatus == 1)
            {
                feeInfo.result      = 1;
                feeInfo.ExitRate    = param.Get <decimal?>("@ExitRate") ?? 0;
                feeInfo.RewardRate  = param.Get <decimal?>("@RewardRate") ?? 0;
                feeInfo.HoldMonth   = param.Get <int?>("@HoldMonth") ?? 0;
                feeInfo.HoldDay     = param.Get <int?>("@HoldDay") ?? 0;
                feeInfo.HoldDayStr  = string.Format("{0}月{1}天", feeInfo.HoldMonth, feeInfo.HoldDay);
                feeInfo.DueInAmount = param.Get <decimal?>("@DueInAmount") ?? 0;
                feeInfo.msg         = param.Get <string>("@ErrorMsg").ToText();
                feeInfo.ApplyAmount = model.AmountInvestment;
            }
            else
            {
                feeInfo.result = outStatus;
                feeInfo.msg    = param.Get <string>("@ErrorMsg").ToText();
            }
        }
Пример #6
0
        public void GetWXJsApiParam()
        {
            string strOpenId = GlobalUtils.OpenId;

            if (strOpenId.IsEmpty())
            {
                PrintJson("-1", "微信未授权,取不到OpenId值");
                return;
            }
            Guid?userId = WebUserAuth.UserId;

            if (userId == null || userId == Guid.Empty)
            {
                PrintJson("-1", "对不起,您还未登录!");
                return;
            }
            TuanDai.PortalSystem.BLL.UserBLL bll = new TuanDai.PortalSystem.BLL.UserBLL();
            UserBasicInfoInfo userModel          = bll.GetUserBasicInfoModelById(userId.Value);

            if (userModel == null)
            {
                PrintJson("-1", "对不起,该用户不存在!");
                return;
            }
            decimal Amount    = Tool.SafeConvert.ToDecimal(WEBRequest.GetFormString("Amount"), 0);
            decimal tmpAmount = Math.Floor(Amount * 100) / 100;

            if (tmpAmount != Amount)
            {
                PrintJson("-1", "充值金额最多只能2位小数,如106.32!");
                return;
            }
            WebSettingInfo rechargeSet       = new TuanDai.PortalSystem.DAL.WebSettingDAL().GetWebSettingInfo("9A89CBAE-6550-4EA1-8224-EB645F38F8FA");
            decimal        MinRechargeAmount = decimal.Parse(rechargeSet.Param1Value);

            if (Amount < MinRechargeAmount)
            {
                PrintJson("-1", "最低充值金额为" + MinRechargeAmount.ToString("N2") + "元!");
                return;
            }
            if (Amount > 500000)
            {
                PrintJson("-1", "单次充值不能超过50万!");
                return;
            }

            NoHandler noHandler = new NoHandler();
            string    orderNo   = noHandler.OnLineRechare();

            if (orderNo == "0")
            {
                PrintJson("-1", "您好,您的提交失败请重试!");
                return;
            }

            int    Sel        = 9; //标记是微信支付
            Guid   rechargeId = Guid.NewGuid();
            int    outStatus  = 0;
            string bankcode   = "";
            string userIP     = Tool.WebFormHandler.GetIP();
            //using (SqlConnection connection = TuanDai.PortalSystem.DAL.PubConstant.CrateConnection())
            //{
            var paramData = new Dapper.DynamicParameters();

            paramData.Add("@userid", userId);
            paramData.Add("@type", Sel);
            paramData.Add("@amount", Amount);
            paramData.Add("@orderNo", orderNo);
            paramData.Add("@backcode", bankcode);
            paramData.Add("@clientIp", userIP);
            paramData.Add("@from", "5");
            paramData.Add("@outStatus", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
            TuanDai.DB.TuanDaiDB.Execute(TdConfig.DBFundWrite, "AccountRechargeInit", ref paramData, CommandType.StoredProcedure);
            outStatus = paramData.Get <int>("@outStatus");
            //    connection.Execute("AccountRechargeInit", paramData, null, null, System.Data.CommandType.StoredProcedure);
            //    outStatus = paramData.Get<int>("@outStatus");
            //    connection.Close();
            //    connection.Dispose();
            //}


            int result = outStatus;

            if (result > 0)
            {
                TuanDai.Payment.PaymentBLL jsApiPay           = new TuanDai.Payment.PaymentBLL("JSAPI", strOpenId, orderNo, userModel.RealName, userModel.IdentityCard);
                TuanDai.Payment.WxPayData  unifiedOrderResult = null;
                try
                {
                    int PayAmount = int.Parse(double.Parse((Amount * 100).ToString()).ToString());

                    unifiedOrderResult = jsApiPay.WXJsApiUnifiedOrder(PayAmount.ToString());
                }
                catch (Exception ex)
                {
                    PrintJson("-1", ex.Message);
                    return;
                }
                string wxJsApiParam = jsApiPay.GetJsApiParameters();//获取H5调起JS API参数
                var    jsonData     = new { result = "1", msg = wxJsApiParam };
                PrintJson(jsonData);
            }
            else
            {
                PrintJson("-1", "您好,您的提交失败请重试!");
                return;
            }
        }
Пример #7
0
        //private JunTeEntities dbread = JunTeEntities.Read();

        public void GetSMBJingZhiPageList()
        {
            int pagesize  = SafeConvert.ToInt32(Context.Request.Form["pagesize"], 6);
            int pageindex = SafeConvert.ToInt32(Context.Request.Form["pageindex"], 1);

            if (pageindex < 1)
            {
                pageindex = 1;
            }
            Guid projectid = SafeConvert.ToGuid(Context.Request.Form["projectid"]) ?? Guid.Empty;

            if (projectid == Guid.Empty)
            {
                PrintJson("-1", "项目编号有误");
            }

            string sql = @"SELECT @Total=COUNT(1) FROM ProjectFundDetail_SM(NOLOCK) WHERE projectId=@projectId;
                    SELECT * FROM (
                    SELECT ROW_NUMBER() OVER(ORDER BY PriceDate DESC) AS RowNumber,* FROM ProjectFundDetail_SM(NOLOCK) 
                     WHERE projectId=@projectId
                    )T WHERE T.RowNumber BETWEEN (@pageIndex-1)*@pageSize+1 AND @pageIndex*@pageSize";

            //var whereParams = new[]
            //{
            //    new SqlParameter("@Total", 0), new SqlParameter("@projectId", projectid),
            //    new SqlParameter("@pageIndex", pageindex),
            //    new SqlParameter("@pageSize", pagesize)
            //};
            //whereParams[0].Direction = ParameterDirection.Output;
            var paras = new Dapper.DynamicParameters();

            paras.Add("@Total", 0, DbType.Int32, ParameterDirection.Output);
            paras.Add("@pageIndex", pageindex);
            paras.Add("@pageSize", pagesize);
            paras.Add("@projectId", projectid);
            var list = new List <SMBProjectFundDetailInfo>();

            //list = dbread.ExecuteStoreQuery<SMBProjectFundDetailInfo>(sql, whereParams).ToList();
            list = TuanDai.DB.TuanDaiDB.Query <SMBProjectFundDetailInfo>(TdConfig.DBRead, sql, ref paras);
            int totalItemCount = paras.Get <int>("@Total");
            //int.TryParse(whereParams[0].Value.ToString(), out totalItemCount);
            var sb    = new StringBuilder();
            int index = 1;

            double divide = totalItemCount / pagesize;
            double floor  = Math.Floor(divide);

            if (totalItemCount % pagesize != 0)
            {
                floor++;
            }
            int pageCount = Convert.ToInt32(floor); //总页数

            sb.Append("{\"result\":\"1\",\"pageCount\":\"" + pageCount + "\",\"list\":[");
            foreach (SMBProjectFundDetailInfo item in list)
            {
                sb.Append("{");
                sb.AppendFormat("\"PriceDate\":\"{0}\",", item.PriceDate.ToString("yyyy-MM-dd"));
                sb.AppendFormat("\"Price\":\"{0}\",", item.Price);
                sb.AppendFormat("\"TotalPrice\":\"{0}\"", item.TotalPrice);
                sb.Append("},");

                if (list.Count == index)
                {
                    sb.Length = sb.Length - 1;
                }
                index++;
            }
            sb.Append("]}");

            Context.Response.Write(sb.ToString());
            Context.Response.End();
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid userid = WebUserAuth.UserId.Value;

            var bankmodel = new BankInfoBLL().GetBankInfoListByUserId(userid);

            if (bankmodel != null && bankmodel.Count > 0)
            {
                if (bankmodel.Any(p => p.Status == 2))
                {
                    Response.Write("您好,银行卡在审核中不允许充值!");
                    ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('您好,银行卡在审核中不允许充值!','1','确定');</script>");
                    return;
                }
            }

            decimal Amount    = Tool.SafeConvert.ToDecimal(Request.Params["Amount"], 0);
            decimal tmpAmount = Math.Floor(Amount * 100) / 100;

            if (tmpAmount != Amount)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('充值金额最多只能2位小数,如106.32!','1','确定');</script>");
                return;
            }
            TuanDai.PortalSystem.Model.WebSettingInfo rechargeSet = new TuanDai.PortalSystem.DAL.WebSettingDAL().GetWebSettingInfo("9A89CBAE-6550-4EA1-8224-EB645F38F8FA");
            decimal minRecharge = decimal.Parse(rechargeSet.Param1Value);

            if (Amount < minRecharge)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('单次充值最少" + minRecharge.ToString("N2") + "元!','1','确定');</script>");
                return;
            }
            if (Amount > 500000)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('单次充值不能超过50万!','1','确定');</script>");
                return;
            }
            NoHandler noHandler = new NoHandler();
            string    orderNo   = noHandler.OnLineRechare();

            if (orderNo == "0")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('您好,您的提交失败请重试!','1','确定');</script>");
                return;
            }

            int    Sel        = Tool.SafeConvert.ToInt32(Request.Params["Sel"], 8);
            Guid   rechargeId = Guid.NewGuid();
            int    outStatus  = 0;
            string bankcode   = "";

            if (Request.Params["bankcode"] != null)
            {
                bankcode = Request.Params["bankcode"];
            }
            string userIP = Tool.WebFormHandler.GetIP();

            var paramData = new Dapper.DynamicParameters();

            paramData.Add("@userid", userid);
            paramData.Add("@type", Sel);
            paramData.Add("@amount", Amount);
            paramData.Add("@orderNo", orderNo);
            paramData.Add("@backcode", bankcode);
            paramData.Add("@clientIp", userIP);
            paramData.Add("@from", "5");
            paramData.Add("@outStatus", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
            PublicConn.ExecuteTD(PublicConn.DBWriteType.FundWrite, "AccountRechargeInit", ref paramData, CommandType.StoredProcedure);
            outStatus = paramData.Get <int>("@outStatus");

            int result = outStatus;

            if (result > 0)
            {
                lock (lockstatus)
                {
                    if (UpdateAccountRechare(5, orderNo) <= 0)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('您好,您的提交失败请重试!','1','确定');</script>");
                        return;
                    }

                    Response.Redirect("/PaymentPlatform/lianlian/plainPay.aspx?orderno=" + orderNo + "&totalprice=" + Amount + "&bankcode=" + bankcode);
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('您好,您的提交失败请重试!','1','确定');</script>");
            }
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid userid = WebUserAuth.UserId.Value;
            //if (GetBankInfo(userid, 2) == 1)
            //{
            //    //if (bankmodel.Status==2)
            //    //{
            //    //Response.Write("您好,银行卡在审核中不允许充值!");
            //    ClientScript.RegisterStartupScript(this.GetType(), "ss",
            //        "<script>ShowMsg('您好,银行卡在审核中不允许充值!','1','确定');</script>");
            //    return;
            //    //}
            //}
            decimal Amount    = Tool.SafeConvert.ToDecimal(Request.Params["Amount"], 0);
            decimal tmpAmount = Math.Floor(Amount * 100) / 100;

            if (tmpAmount != Amount)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('充值金额最多只能2位小数,如106.32!','1','确定');</script>");
                return;
            }
            TuanDai.PortalSystem.Model.WebSettingInfo rechargeSet =
                new TuanDai.PortalSystem.DAL.WebSettingDAL().GetWebSettingInfo("9A89CBAE-6550-4EA1-8224-EB645F38F8FA");
            decimal minRecharge = decimal.Parse(rechargeSet.Param1Value);

            if (Amount < minRecharge)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('单次充值最少" + minRecharge.ToString("N2") + "元!','1','确定');</script>");
                return;
            }
            if (Amount > 500000)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('单次充值不能超过50万!','1','确定');</script>");
                return;
            }

            var cgtMode = new QueryClient().GetUserByPlatformUserNo(userid);

            if (cgtMode == null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('存管通未开通,不能进行充值!','1','确定');</script>");
                return;
            }
            if (!cgtMode.isActivate)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('存管通未激活,不能进行充值!','1','确定');</script>");
                return;
            }

            NoHandler noHandler = new NoHandler();
            string    orderNo   = noHandler.OnLineRechare();

            if (orderNo == "0")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('您好,您的提交失败请重试!','1','确定');</script>");
                return;
            }

            string err        = string.Empty;
            bool   isRecharge = new CgtCheckBLL().GetUserCgtIsOper(userid, "recharge", ref err);

            if (!isRecharge)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "ss",
                                                   "<script>ShowMsg('" + err + "','1','确定');</script>");
                return;
            }
            //获取银行卡号
            string bankNo  = Request["bankno"];
            string outCode = string.Empty;

            if (!string.IsNullOrEmpty(bankNo))
            {
                try
                {
                    bankNo = Tool.DESC.Decrypt(bankNo);
                }
                catch (Exception)
                {
                    bankNo = null;
                }
            }

            BankFromJavaService bankJavaService = new BankFromJavaService();

            if (GlobalUtils.IsBankService)
            {
                var bankInfoFromJava = bankJavaService.GetBankInfo(userid, ServiceType.NotTuomin);
                if (bankInfoFromJava != null && bankInfoFromJava.respData != null)
                {
                    bankNo  = bankInfoFromJava.respData.bankNo;
                    outCode = bankInfoFromJava.respData.bankCode;
                }
            }
            else
            {
                var userInfo = new PortalSystem.BLL.UserBLL().GetUserBasicInfoModelById(userid);
                if (userInfo == null || string.IsNullOrEmpty(userInfo.BankAccountNo))
                {
                    var bankInfo = GlobalUtils.GetBankInfo(userid);
                    bankNo = bankInfo.BankNo;
                }
                else
                {
                    bankNo = userInfo.BankAccountNo;
                }
            }

            string userIP = Tool.WebFormHandler.GetIP();

            if (!GlobalUtils.IsBankService)
            {
                var sss = TuanDai.Payment.Client.BankInfo.GetPayBankInfo(userid);

                TuanDai.Payment.Models.PayRoute.RouteInfo bank = new TuanDai.Payment.Client.Recharge().GetCgtRechargeInfo(userid, sss.BankNo);
                int Sel = bank.Sel;

                int    outStatus = 0;
                string bankcode  = "";
                if (Request.Params["bankcode"] != null)
                {
                    bankcode = Request.Params["bankcode"];
                }


                var paramData = new Dapper.DynamicParameters();
                paramData.Add("@userid", userid);
                paramData.Add("@type", Sel);
                paramData.Add("@amount", Amount);
                paramData.Add("@orderNo", orderNo);
                paramData.Add("@backcode", bankcode);
                paramData.Add("@clientIp", userIP);
                paramData.Add("@from", "5");
                if (bank.RouteId.IsEmpty())
                {
                    paramData.Add("@RouteId", null);
                }
                else
                {
                    paramData.Add("@RouteId", bank.RouteId);
                }
                paramData.Add("@outStatus", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
                paramData.Add("@cmorderNo", "");
                PublicConn.ExecuteTD(PublicConn.DBWriteType.FundWrite, "p_cgt_AccountRechargeInit", ref paramData, CommandType.StoredProcedure);
                outStatus = paramData.Get <int>("@outStatus");

                int result = outStatus;
                if (result > 0)
                {
                    lock (lockstatus)
                    {
                        var isCallBackPayment =
                            System.Configuration.ConfigurationManager.AppSettings["IsCallBackPayment"];
                        var    paymentUrl  = System.Configuration.ConfigurationManager.AppSettings["PaymentUrl"];
                        string callBackUrl = paymentUrl + "/PaymentPlatform/H5/commonCallBack.aspx";
                        if (isCallBackPayment == "0")
                        {
                            callBackUrl = CgtCallBackConfig.GetCgtCallBackUrl(CgtCallBackConfig.CgtCallBackType.Recharge);
                        }
                        var recharInfo = new Payment.Client.Recharge().GetCgtRechargeInfo(userid, bankNo);
                        var url        = CunGuanTong.Client.FundClient.RECHARGE_Req(new CunGuanTong.Model.RECHARGE_Request
                        {
                            rechargeWay      = rechargeWay.SWIFT,
                            requestNo        = orderNo,
                            amount           = Amount,
                            bankcode         = recharInfo.OutCode,
                            callbackMode     = "DIRECT_CALLBACK",
                            platformUserNo   = userid.ToString(),
                            expectPayCompany = recharInfo.CgtPayCompany,
                            //callbackUrl = CgtCallBackConfig.GetCgtCallBackUrl(CgtCallBackConfig.CgtCallBackType.Recharge),
                            callbackUrl = callBackUrl,
                            userDevice  = CunGuanTong.Model.userDevice.MOBILE
                        });

                        if (string.IsNullOrEmpty(url))
                        {
                            if (Request.UrlReferrer != null)
                            {
                                url = Request.UrlReferrer.ToString();
                            }
                            else
                            {
                                url = GlobalUtils.WebURL;
                            }
                        }
                        Response.Redirect(url);
                    }
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "ss", "<script>ShowMsg('您好,充值提交失败请重试!','1','确定');</script>");
                }
            }
            else
            {  //走Java银行卡服务
                string retUrl = bankJavaService.GetCgtRechargeUrl(userid, bankNo, Amount, userIP, outCode);
                if (!string.IsNullOrEmpty(retUrl))
                {
                    Response.Redirect(retUrl);
                }
            }
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid userid = WebUserAuth.UserId.Value;

            decimal Amount = Tool.SafeConvert.ToDecimal(Request.Params["Amount"], 0);

            //if (Amount < 100)
            //{
            //    Response.Write("您好,充值金额必须大于或者等于100!");
            //    return;
            //}

            if (Amount > 5000000)
            {
                Response.Write("单次充值不能超过500万!");
                return;
            }


            NoHandler noHandler = new NoHandler();
            string    orderNo   = noHandler.OnLineRechare();

            if (orderNo == "0")
            {
                Response.Write("您好,您的提交失败请重试!");
                return;
            }

            int  Sel        = Tool.SafeConvert.ToInt32(Request.Params["Sel"], 12);
            Guid rechargeId = Guid.NewGuid();
            int  outStatus  = 0;

            //string bankcode = "";
            //bankcode = Request.Params["bankcode"];
            ////if (Request.Params["bankcode"] != null)
            ////{

            ////}

            //if (string.IsNullOrEmpty(bankcode))
            //{
            //    Response.Write("您好,银行编号获取错误!" + Request.QueryString["bankcode"]);
            //    return;
            //}

            string userIP = Tool.WebFormHandler.GetIP();

            var paramData = new Dapper.DynamicParameters();

            paramData.Add("@userid", userid);
            paramData.Add("@type", Sel);
            paramData.Add("@amount", Amount);
            paramData.Add("@orderNo", orderNo);
            paramData.Add("@backcode", "");
            paramData.Add("@clientIp", userIP);
            paramData.Add("@from", "5");
            paramData.Add("@outStatus", 0, System.Data.DbType.Int32, System.Data.ParameterDirection.Output);
            TuanDai.WXApiWeb.PublicConn.ExecuteTD(PublicConn.DBWriteType.FundWrite, "AccountRechargeInit",
                                                  ref paramData, CommandType.StoredProcedure);
            outStatus = paramData.Get <int>("@outStatus");

            int result = outStatus;

            //NetLog.WriteLoginHandler("宝付5-调用写入充值记录存储过AccountRechargeInit", "UserId:"+userid+",Sel:"+Sel+",Amount:"+Amount+",OrderNo:"+orderNo+",bankcode:"+bankcode+",OutStatus:"+outStatus.Value.ToString());
            if (result > 0)
            {
                //NetLog.WriteLoginHandler("宝付6","进入写入来源" );
                AccountRechareInfo ar = null;
                lock (lockstatus)
                {
                    ar = getAccountRechare(orderNo);
                }
                //1:PC
                if (null == ar)
                {
                    Response.Write("您好,您的提交失败请重试!");
                }

                ar.From = 5;
                //ar.CradNo = db.UserBasicInfo.FirstOrDefault(x => x.Id == userid).BankAccountNo;

                if (UpdateAccountRechare(ar) <= 0)
                {
                    Response.Write("您好,您的提交失败请重试!");
                    return;
                }

                //NetLog.WriteLoginHandler("宝付7", "进入跳转");
                var url = "/PaymentPlatform/Baofu/pay_post.aspx?orderno=" + orderNo + "&totalprice=" + Amount + "&PayID=";
                //NetLog.WriteLoginHandler("宝付8--跳转的URL", url);
                try
                {
                    Response.Redirect(url, false);
                }
                catch (Exception ex)
                {
                    SysLogHelper.WriteErrorLog("宝付9跳转错误", "错误详细信息:" + ex.Message + "|" + ex.StackTrace);
                }
            }
            else
            {
                Response.Write("您好,您的提交失败请重试!");
            }
        }