Beispiel #1
0
        /// <summary>
        /// 骑士提现申请单打款失败
        /// danny-20150513
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool ClienterWithdrawPayFailed(ClienterWithdrawLogModel model)
        {
            string        sql  = string.Format(@" 
UPDATE ClienterWithdrawForm
 SET    [Status] = @Status,
		Payer=@Operator,
		PayTime=getdate(),
        PayFailedReason=@PayFailedReason
OUTPUT
  Inserted.Id,
  Inserted.[Status],
  @Remark,
  @Operator,
  getdate()
INTO ClienterWithdrawLog
  ([WithwardId],
  [Status],
  [Remark],
  [Operator],
  [OperatTime])
 WHERE  Id = @Id");
            IDbParameters parm = DbHelper.CreateDbParameters();

            parm.AddWithValue("@Status", model.Status);
            parm.AddWithValue("@Operator", model.Operator);
            parm.AddWithValue("@Remark", model.Remark);
            parm.AddWithValue("@PayFailedReason", model.PayFailedReason);
            parm.AddWithValue("@Id", model.WithwardId);
            return(DbHelper.ExecuteNonQuery(SuperMan_Write, sql, parm) > 0);
        }
        public JsonResult WithdrawPayFailed(string withwardId, string payFailedReason)
        {
            var clienterWithdrawLog = new ClienterWithdrawLogModel()
            {
                Operator        = UserContext.Current.Name,
                Remark          = "骑士提款申请单打款失败-" + payFailedReason,
                Status          = ClienterWithdrawFormStatus.Error.GetHashCode(),
                WithwardId      = Convert.ToInt64(withwardId),
                PayFailedReason = payFailedReason
            };
            var reg = iClienterFinanceProvider.ClienterWithdrawPayFailed(clienterWithdrawLog);

            return(Json(new ResultModel(reg, reg ? "打款失败操作提交成功!" : "打款失败操作提交失败!"), JsonRequestBehavior.DenyGet));
        }
        public JsonResult WithdrawAuditRefuse(string withwardId, string auditFailedReason)
        {
            var clienterWithdrawLog = new ClienterWithdrawLogModel()
            {
                Operator          = UserContext.Current.Name,
                Remark            = "骑士提款申请单审核拒绝-" + auditFailedReason,
                Status            = ClienterWithdrawFormStatus.TurnDown.GetHashCode(),
                WithwardId        = Convert.ToInt64(withwardId),
                AuditFailedReason = auditFailedReason
            };
            var reg = iClienterFinanceProvider.ClienterWithdrawAuditRefuse(clienterWithdrawLog);

            return(Json(new ResultModel(reg, reg ? "审核拒绝成功!" : "审核拒绝失败!"), JsonRequestBehavior.DenyGet));
        }
Beispiel #4
0
        /// <summary>
        /// 骑士提现失败后返现
        /// danny-20150513
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool ClienterWithdrawReturn(ClienterWithdrawLogModel model)
        {
            string        sql  = string.Format(@" 
insert into ClienterBalanceRecord
            ([ClienterId]
           ,[Amount]
           ,[Status]
           ,[Balance]
           ,[RecordType]
           ,[Operator]
           ,[OperateTime]
           ,[WithwardId]
           ,[RelationNo]
           ,[Remark])
select      cbr.[ClienterId]
           ,-ISNULL(cbr.[Amount],0) Amount
           ,@NewStatus [Status]
           ,-ISNULL(cbr.[Amount],0)+ISNULL(c.AccountBalance,0) Balance
           ,@NewRecordType [RecordType]
           ,@Operator
           ,getdate() OperateTime
           ,cbr.[WithwardId]
           ,cbr.[RelationNo]
           ,@Remark
 from ClienterBalanceRecord cbr (nolock)
    join clienter c (nolock) on c.Id=cbr.ClienterId
 where cbr.WithwardId=@WithwardId and cbr.Status=@Status and cbr.RecordType=@RecordType;");
            IDbParameters parm = DbHelper.CreateDbParameters();

            parm.AddWithValue("@Operator", model.Operator);
            parm.AddWithValue("@Remark", model.Remark);
            parm.AddWithValue("@WithwardId", model.WithwardId);
            parm.AddWithValue("@Status", ClienterBalanceRecordStatus.Tradeing.GetHashCode());
            parm.AddWithValue("@RecordType", ClienterBalanceRecordRecordType.WithdrawApply.GetHashCode());
            parm.AddWithValue("@NewStatus", ClienterBalanceRecordStatus.Success.GetHashCode());
            parm.AddWithValue("@NewRecordType", model.Status == ClienterWithdrawFormStatus.TurnDown.GetHashCode() ? ClienterBalanceRecordRecordType.WithdrawRefuse : ClienterBalanceRecordRecordType.PayFailure);
            return(DbHelper.ExecuteNonQuery(SuperMan_Write, sql, parm) > 0);
        }
        /// <summary>
        /// 骑士提现申请单打款失败
        /// danny-20150513
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool ClienterWithdrawPayFailed(ClienterWithdrawLogModel model)
        {
            bool reg = false;

            using (IUnitOfWork tran = EdsUtilOfWorkFactory.GetUnitOfWorkOfEDS())
            {
                if (clienterFinanceDao.ClienterWithdrawReturn(model))
                {
                    if (clienterFinanceDao.ClienterWithdrawPayFailed(model))
                    {
                        if (clienterFinanceDao.ModifyClienterBalanceRecordStatus(model.WithwardId.ToString()))
                        {
                            if (clienterFinanceDao.ModifyClienterAmountInfo(model.WithwardId.ToString()))
                            {
                                reg = true;
                                tran.Complete();
                            }
                        }
                    }
                }
            }
            return(reg);
        }