Beispiel #1
0
        public ActionResult CashDeposit()
        {
            CashAccountCashDepositArgs args = RequestArgs <CashAccountCashDepositArgs>();

            if (args == null)
            {
                return(RespondResult(false, "参数无效。"));
            }

            //JS浮点乘法有BUG,不可在前端运算,如1.11*100得到错误结果
            args.Fee = args.Fee * 100;

            args.Domain       = DomainContext.Domain.Id;
            args.AppId        = DomainContext.AppId;
            args.IP           = Request.UserHostAddress;
            args.OperatorUser = UserContext.User.Id;

            CashAccountTrackResult trackResult = _payManager.CashDeposit(args);

            #region 操作日志

            _operatedLogManager.Create(new OperatedLogEntity()
            {
                Domain      = DomainContext.Domain.Id,
                AppId       = DomainContext.AppId,
                User        = UserContext.User.Id,
                IP          = Request.UserHostAddress,
                Module      = EnumModule.Pay,
                Description = "现金充值"
            });

            #endregion

            return(RespondDataResult(trackResult));
        }
Beispiel #2
0
        /// <summary>
        /// 线下现金充值
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public CashAccountTrackResult CashDeposit(CashAccountCashDepositArgs args)
        {
            CashAccountTrackResult result = new CashAccountTrackResult();

            List <CommandParameter> parameterList = new List <CommandParameter>();

            parameterList.Add(new CommandParameter("@domainId", args.Domain));
            parameterList.Add(new CommandParameter("@appId", args.AppId));
            parameterList.Add(new CommandParameter("@memberId", args.MemberId));
            parameterList.Add(new CommandParameter("@fee", args.Fee));
            parameterList.Add(new CommandParameter("@remark", args.Remark));
            parameterList.Add(new CommandParameter("@type", EnumCashAccountTrackType.CashDeposit));
            parameterList.Add(new CommandParameter("@operatorUser", args.OperatorUser));
            parameterList.Add(new CommandParameter("@ip", args.IP));

            DataSet dsResult =
                _dataBase.ExecuteDataSet(CommandType.StoredProcedure, "TrackMemberCash", parameterList,
                                         new string[] { "result" });

            result.Reason = int.Parse(dsResult.Tables[0].Rows[0]["Result"].ToString());
            if (result.Reason == 0)
            {
                result.LeftCashAccount = int.Parse(dsResult.Tables[0].Rows[0]["CashAccount"].ToString());
            }
            result.Success = result.Reason == 0;

            return(result);
        }