Example #1
0
        /// <summary>
        /// 会员修改提现申请
        /// </summary>
        /// <param name="w"></param>
        /// <returns></returns>
        public static bool updateWithdraw(SqlTransaction tran, WithdrawModel w)
        {
            string sql = "update withdraw set AuditExpectNum=0,AuditingTime='1900-1-1 0:00:00',ApplicationExpectNum=@ApplicationExpectNum,WithdrawMoney=@WithdrawMoney,WithdrawTime=@WithdrawTime,OperateIP=@OperateIP,remark=@remark,bankcard=@bankcard,bankname=@bankname where id=@id";

            SqlParameter[] par = new SqlParameter[] {
                new SqlParameter("@ApplicationExpectNum", w.ApplicationExpecdtNum),
                new SqlParameter("@WithdrawMoney", w.WithdrawMoney),
                new SqlParameter("@WithdrawTime", w.WithdrawTime),
                new SqlParameter("@OperateIP", w.OperateIP),
                new SqlParameter("@remark", w.Remark),
                new SqlParameter("@bankcard", w.Bankcard),
                new SqlParameter("@bankname", w.Bankname),
                new SqlParameter("@id", w.Id)
            };
            int num = DBHelper.ExecuteNonQuery(tran, sql, par, CommandType.Text);

            if (num > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// 修改审核状态、时间——ds2012——tianfeng
        /// </summary>
        /// <param name="tran"></param>
        /// <param name="dModel"></param>
        /// <returns></returns>
        public static bool SetWithdrawState(SqlTransaction tran, WithdrawModel dModel)
        {
            string strSql = "Update MemberCash set isAuditing=2,auditExpectNum=@ExpectNum,AuditingTime=@auditTime,AuditingmanageId=@AuditingManageId,AuditingIp=@AuditingIp where id=@id";

            SqlParameter[] para =
            {
                new SqlParameter("@ExpectNum",        SqlDbType.Int),
                new SqlParameter("@auditTime",        SqlDbType.DateTime),
                new SqlParameter("@AuditingManageId", SqlDbType.NVarChar,  30),
                new SqlParameter("@AuditingIp",       SqlDbType.NVarChar,  50),
                new SqlParameter("@id",               SqlDbType.Int)
            };
            para[0].Value = dModel.AuditExpectNum;
            para[1].Value = dModel.AuditTime;
            para[2].Value = dModel.AuditingManageId;
            para[3].Value = dModel.AuditingIP;
            para[4].Value = dModel.Id;

            int count = (int)DBHelper.ExecuteNonQuery(tran, strSql, para, CommandType.Text);

            if (count == 0)
            {
                return(false);
            }
            return(true);
        }
Example #3
0
        public static bool XF(SqlTransaction tran, WithdrawModel dModel)
        {
            string strSql = @"insert into MemberCashXF(Number,XFTime,ipon,XFON,XFEN,ps,XFState)
                                values(@Number,@XFTime,@ipon,@XFON,@XFEN,@ps,@XFState)";

            SqlParameter[] para =
            {
                new SqlParameter("@Number",  dModel.Number),
                new SqlParameter("@XFTime",  dModel.WithdrawTime),
                new SqlParameter("@ipon",    dModel.OperateIP),
                new SqlParameter("@XFON",    dModel.WithdrawMoney),
                new SqlParameter("@XFEN",    dModel.WithdrawSXF),
                new SqlParameter("@ps",      dModel.Remark),
                new SqlParameter("@XFState", dModel.ApplicationExpecdtNum)
            };


            int count = (int)DBHelper.ExecuteNonQuery(tran, strSql, para, CommandType.Text);

            if (count <= 0)
            {
                return(false);
            }
            return(true);
        }
        public void WithdrawTooMuch()
        {
            using (var context = new BankDbContext(options))
            {
                int id    = 1;
                var model = new WithdrawModel()
                {
                    AccountId = id,
                    Amount    = "200.00"
                };
                var account = new Account()
                {
                    AccountId = id,
                    Balance   = 100
                };

                context.Accounts.Add(account);
                context.SaveChanges();

                new WithdrawCommand().RunAsync(context, model).Wait();
                int numOfTransactions = context.Transactions.Where(t => t.AccountId == account.AccountId).Count();

                var createdAccount = context.Accounts.Single(a => a.AccountId == id);

                // Check balance
                Assert.Equal(100, createdAccount.Balance);

                // Checks so that no transaction was made
                Assert.Equal(0, numOfTransactions);
            }
        }
        public async Task <ActionResult> Withdraw(WithdrawModel model)
        {
            var creditCardDTO = await _creditCardService.GetCreditCard(model.CreditCardId);

            if (creditCardDTO.Balance < model.WithdrawalAmount)
            {
                return(RedirectToAction("Error", "Home", new { errorMessage = "Not enough money on your account " }));
            }
            await _operationRepository.AddOperation(model.CreditCardId, 2, $"{model.WithdrawalAmount}$ was withdrawn");

            var balance = creditCardDTO.Balance - model.WithdrawalAmount;
            await _creditCardRepository.SetBalance(model.CreditCardId, balance);

            var reportModel = new ReportModel
            {
                CreditCardId     = model.CreditCardId,
                WithdrawalAmount = model.WithdrawalAmount,
                Balance          = balance,
                CreditCardNumber = creditCardDTO.CreditCardNumber,
                DateOfWithdrawal = DateTime.Now
            };

            TempData["ReportModel"] = reportModel;

            return(RedirectToAction("Report"));
        }
Example #6
0
        public async Task <IResult <WithdrawModel> > Withdraw(WithdrawModel withdrawModel)
        {
            try
            {
                var account = await _sharedService.AccountValidate(withdrawModel.Cpf, withdrawModel.Password);

                if (!account.Success)
                {
                    return(Result <WithdrawModel> .BuildError(account.Messages).LoggerError());
                }

                var tax = withdrawModel.Amount.GetPercentage(1);
                withdrawModel.Tax = tax;

                if (account.Model.Balance < withdrawModel.Amount + tax)
                {
                    return(Result <WithdrawModel> .BuildError($"Saldo insuficiente, " +
                                                              $"seu saldo permitido para transaferência é {account.Model.Balance - tax}").LoggerError());
                }

                account.Model.Balance -= (withdrawModel.Amount + tax);
                await _movementService.CreateMovement(withdrawModel.Amount, MovementType.Withdraw, account.Model,
                                                      account.Model.Balance, tax : tax);

                await _accountRepository.SaveAsync();

                return(Result <WithdrawModel> .BuildSucess(withdrawModel, "Saque realizado com sucesso!"));
            }
            catch (Exception error)
            {
                return(Result <WithdrawModel> .BuildError("Erro ao realizar saque, favor tente novamento", error)
                       .LoggerError());
            }
        }
Example #7
0
        public static bool MemberCash(SqlTransaction tran, WithdrawModel dModel)
        {
            string strSql = @"insert into MemberCash(number,applicationExpectNum,auditExpectNum,isAuditing,WithdrawMoney,WithdrawTime,OperateIP,remark,bankcard,bankname,WithdrawSXF,Khname,IsJL,Wyj,blmoney,Wyjbl ,InvestJB,priceJB,DrawCardtype,AliNo,WeiXNo,InvestJBSXF,InvestJBWYJ ,actype)
                                values(@Number,@ApplicationExpectNum,@AuditingExpectNum,@IsAuditing,@WithdrawMoney,@WithdrawTime,@OperateIP,@Remark,@bankcard,@bankname,@WithdrawSXF,@Khname,@IsJL,@Wyj,@blmoney,@Wyjbl,@InvestJB,@priceJB,@DrawCardtype,@AliNo,@WeiXNo,@InvestJBSXF,@InvestJBWYJ ,@actype)";

            SqlParameter[] para =
            {
                new SqlParameter("@Number",               SqlDbType.NVarChar,     50),
                new SqlParameter("@ApplicationExpectNum", SqlDbType.Int),
                new SqlParameter("@AuditingExpectNum",    SqlDbType.Int),
                new SqlParameter("@IsAuditing",           SqlDbType.Int),
                new SqlParameter("@WithdrawMoney",        SqlDbType.Money),
                new SqlParameter("@WithdrawTime",         SqlDbType.DateTime,      8),
                new SqlParameter("@OperateIP",            SqlDbType.NVarChar,     30),
                new SqlParameter("@Remark",               SqlDbType.NVarChar,   1000),
                new SqlParameter("@bankcard",             SqlDbType.NVarChar,     50),
                new SqlParameter("@bankname",             SqlDbType.NVarChar,     50),
                new SqlParameter("@WithdrawSXF",          SqlDbType.Money),
                new SqlParameter("@Khname",               SqlDbType.NVarChar,     50),
                new SqlParameter("@IsJL",                 SqlDbType.Int),
                new SqlParameter("@Wyj",                  SqlDbType.Money),
                new SqlParameter("@blmoney",              SqlDbType.Float),
                new SqlParameter("@Wyjbl",                SqlDbType.Float),

                new SqlParameter("@InvestJB",             dModel.InvestJB),
                new SqlParameter("@priceJB",              dModel.PriceJB),
                new SqlParameter("@DrawCardtype",         dModel.DrawCardtype),
                new SqlParameter("@AliNo",                dModel.AliNo),
                new SqlParameter("@WeiXNo",               dModel.WeiXNo),
                new SqlParameter("@InvestJBSXF",          dModel.InvestJBSXF),
                new SqlParameter("@InvestJBWYJ",          dModel.InvestJBWYJ),
                new SqlParameter("@actype",               dModel.Actype)
            };
            para[0].Value  = dModel.Number;
            para[1].Value  = dModel.ApplicationExpecdtNum;
            para[2].Value  = 0;
            para[3].Value  = 0;
            para[4].Value  = dModel.WithdrawMoney;
            para[5].Value  = dModel.WithdrawTime;
            para[6].Value  = dModel.OperateIP;
            para[7].Value  = dModel.Remark;
            para[8].Value  = dModel.Bankcard;
            para[9].Value  = dModel.Bankname;
            para[10].Value = dModel.WithdrawSXF;
            para[11].Value = dModel.Khname;
            para[12].Value = dModel.IsJL;
            para[13].Value = dModel.Wyj;
            para[14].Value = dModel.blmoney;
            para[15].Value = dModel.Wyjbl;


            int count = (int)DBHelper.ExecuteNonQuery(tran, strSql, para, CommandType.Text);

            if (count <= 0)
            {
                return(false);
            }
            return(true);
        }
Example #8
0
        public async Task InformacoesDaOperacaoIncorretasParaSaque(int conta, decimal valor)
        {
            var withdrawModel = new WithdrawModel()
            {
                AccountNumber = conta, Ammount = valor
            };

            await Assert.ThrowsAsync <Exception>(async() => await _bankAccountService.Withdraw(withdrawModel));
        }
Example #9
0
 public IActionResult Withdraw(WithdrawModel model)
 {
     if (ModelState.IsValid)
     {
         TempData["Status"] = BankRepository.Withdraw(model.Id.ToString(), model.Amount.ToString());
         return(View("Index"));
     }
     TempData["Status"] = "Please fill out every field with valid numbers.";
     return(RedirectToAction("Index"));
 }
        public IHttpActionResult Post(WithdrawModel withdraw)
        {
            Withdrawal withdrawTemp = new Withdrawal();
            var        balance      = Uow.Repository <Balance>().FirstOrDefault(a => a.UserId == withdraw.UserId);

            if (withdraw.Amount <= balance.BalanceAmount)
            {
                var account = Uow.Repository <AccountDetail>().FirstOrDefault(a => a.AccountNumber == withdraw.AccountNumber);
                var branch  = Uow.Repository <BankBranch>().FirstOrDefault(a => (a.IFSC_Code == withdraw.IFSC) && (a.Bank.BankId == withdraw.BankId));
                if (account != null && branch != null)
                {
                    if (account.BankBranchId == branch.BankBranchId)
                    {
                        withdrawTemp.AccountId        = account.AccountId;
                        withdrawTemp.WithdrawalAmount = withdraw.Amount;
                        withdrawTemp.UserId           = withdraw.UserId;
                        withdrawTemp.BankId           = withdraw.BankId;
                        var date = DateTime.Now;
                        withdrawTemp.WithdrawDate   = date;
                        withdrawTemp.WithdrawStatus = true;
                        withdrawTemp.BalanceId      = balance.BalanceId;
                        withdrawTemp.Comment        = withdraw.Comment;

                        var withdrawMessage = WithdrawDomain.Post(withdrawTemp);
                        if (withdrawMessage == "Withdrawal Successfull!!")
                        {
                            var tempBalance = BalanceDomain.GetBy(withdraw.UserId);
                            tempBalance.BalanceAmount = tempBalance.BalanceAmount - withdraw.Amount;
                            var accountDetail = AccountDetailsDomain.Getby(account.AccountId);
                            accountDetail.AccountBalance = accountDetail.AccountBalance + withdraw.Amount;
                            BalanceDomain.Put(tempBalance);
                            AccountDetailsDomain.Put(accountDetail);
                            return(Ok("successfull"));
                        }
                        return(Ok("not successfull"));
                    }
                    else
                    {
                        return(Ok("error"));
                    }
                }
                else
                {
                    return(Ok("error"));
                }
            }
            else
            {
                return(Ok("error"));
            }
        }
        public ActionResult Withdraw()
        {
            var creditCardId = Convert.ToInt32(TempData["creditCardId"]);

            TempData.Keep("creditCardId");
            if (creditCardId != 0)
            {
                ViewBag.TableId = "t-withdraw";
                var model = new WithdrawModel {
                    CreditCardId = creditCardId
                };
                return(View(model));
            }
            return(RedirectToAction("Index", "Home"));
        }
Example #12
0
        public async Task OnGetAsync_ReturnsForbidResult_WithUnAuthorizedUser()
        {
            //Arrange
            var authorizationService = new Mock <IAuthorizationService>();

            authorizationService.Setup(x => x.AuthorizeAsync(It.IsAny <ClaimsPrincipal>(), It.IsAny <object>(), It.IsAny <IEnumerable <IAuthorizationRequirement> >()))
            .ReturnsAsync(AuthorizationResult.Failed());

            var store       = new Mock <IUserStore <IdentityUser> >();
            var userManager = new Mock <UserManager <IdentityUser> >(store.Object, null, null, null, null, null, null, null, null);
            var pageModel   = new WithdrawModel(AppDbContext, authorizationService.Object, userManager.Object);

            //Act
            var result = await pageModel.OnGetAsync(1);

            // Assert
            Assert.IsType <ForbidResult>(result);
        }
Example #13
0
        public async Task ContaCorrenteNaoEncontradaParaSacar()
        {
            int     AccountNumber = 123;
            decimal BalanceAmmout = 120;

            _bankAccountRepository.Setup(x => x.FindAccount(AccountNumber))
            .Returns(Task.FromResult(new BankAccount {
                Number = AccountNumber, Balance = BalanceAmmout
            }));
            _bankAccountRepository.Setup(r => r.SingleUnit.CommitAsync()).Returns(Task.FromResult(true));

            var withdrawModel = new WithdrawModel()
            {
                AccountNumber = 2222, Ammount = 2000
            };

            await Assert.ThrowsAsync <Exception>(async() => await _bankAccountService.Withdraw(withdrawModel));
        }
Example #14
0
        /// <summary>
        /// 以石斛积分冻结
        /// </summary>
        /// <param name="tran"></param>
        /// <param name="wDraw"></param>
        /// <returns></returns>
        public static bool SetMemberShip1JB(SqlTransaction tran, WithdrawModel wDraw)
        {
            string rsql = "";

            if (wDraw.Actype == 1)
            {
                rsql = " pointAFz=pointAFz+@Money ";
            }
            else if (wDraw.Actype == 2)
            {
                rsql = " pointBFz=pointBFz+@Money ";
            }
            else if (wDraw.Actype == 3)
            {
                rsql = " pointCFz=pointCFz+@Money ";
            }
            else if (wDraw.Actype == 4)
            {
                rsql = " pointDFz=pointDFz+@Money ";
            }


            string strSql = "Update MemberInfo Set  " + rsql + ",pointEFz=pointEFz+@sxf where number=@Number";

            SqlParameter[] para =
            {
                new SqlParameter("@Money",  SqlDbType.Money),
                new SqlParameter("@sxf",    SqlDbType.Money),
                new SqlParameter("@Number", SqlDbType.NVarChar, 50),
            };
            para[0].Value = wDraw.InvestJB;
            para[1].Value = wDraw.InvestJBSXF;
            para[2].Value = wDraw.Number;


            int count = (int)DBHelper.ExecuteNonQuery(tran, strSql, para, CommandType.Text);

            if (count <= 0)
            {
                return(false);
            }
            return(true);
        }
Example #15
0
        public async Task SacarValorValidoDaContaCorrente()
        {
            int     AccountNumber = 123;
            decimal BalanceAmmout = 120;

            _bankAccountRepository.Setup(x => x.FindAccount(AccountNumber))
            .Returns(Task.FromResult(new BankAccount {
                Number = AccountNumber, Balance = BalanceAmmout
            }));
            _bankAccountRepository.Setup(r => r.SingleUnit.CommitAsync()).Returns(Task.FromResult(true));

            var withdrawModel = new WithdrawModel()
            {
                AccountNumber = 123, Ammount = 20
            };
            var atual = await _bankAccountService.Withdraw(withdrawModel);

            Assert.Equal(100, atual.Saldo);
        }
Example #16
0
        public async Task <BankAccountModel> Withdraw(WithdrawModel model)
        {
            var validator = new WithdrawValidator(_bankAccountRepository);

            var result = validator.Validate(model);

            if (!result.IsValid)
            {
                throw new Exception(string.Join("; ", result.Errors));
            }

            var account = await _bankAccountRepository.FindAccount(model.AccountNumber);

            account.Balance -= model.Ammount;
            _bankAccountRepository.Change(account);

            await _bankAccountRepository.SingleUnit.CommitAsync();

            return(_mapper.Map <BankAccountModel>(account));
        }
Example #17
0
        public async Task OnPostWithdrawAsync_ReturnsARedirectToPageResult_WhenModelStateIsValid()
        {
            // Arrange
            var authorizationService = new Mock <IAuthorizationService>();

            authorizationService.Setup(x => x.AuthorizeAsync(It.IsAny <ClaimsPrincipal>(), It.IsAny <object>(), It.IsAny <IEnumerable <IAuthorizationRequirement> >()))
            .ReturnsAsync(AuthorizationResult.Success());

            var store = new Mock <IUserStore <IdentityUser> >();
            var mgr   = new Mock <UserManager <IdentityUser> >(store.Object, null, null, null, null, null, null, null, null);

            var httpContext           = new DefaultHttpContext();
            var modelState            = new ModelStateDictionary();
            var actionContext         = new ActionContext(httpContext, new RouteData(), new PageActionDescriptor(), modelState);
            var modelMetadataProvider = new EmptyModelMetadataProvider();
            var viewData    = new ViewDataDictionary(modelMetadataProvider, modelState);
            var tempData    = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>());
            var pageContext = new PageContext(actionContext)
            {
                ViewData = viewData
            };
            var loanId          = 1;
            var loanApplication = await AppDbContext.LoanApplications.AsNoTracking().FirstOrDefaultAsync(m => m.Id == loanId);

            var pageModel = new WithdrawModel(AppDbContext, authorizationService.Object, mgr.Object)
            {
                PageContext     = pageContext,
                TempData        = tempData,
                Url             = new UrlHelper(actionContext),
                LoanApplication = loanApplication,
            };
            // Act
            // A new ModelStateDictionary is valid by default.
            var result = await pageModel.OnPostAsync(loanId);

            var approvalApplication = await AppDbContext.LoanApplications.FirstOrDefaultAsync(m => m.Id == loanId);

            // Assert
            Assert.IsType <RedirectToPageResult>(result);
            Assert.Equal(LoanStatus.Withdrawn, approvalApplication.Status);
        }
Example #18
0
        public async Task <IActionResult> Withdraw([FromBody] WithdrawRequest request)
        {
            var command = new WithdrawCommand(
                request.AccountId,
                request.Amount);

            WithdrawResult depositResult = await withdrawService.Handle(command);

            if (depositResult == null)
            {
                return(new NoContentResult());
            }

            WithdrawModel model = new WithdrawModel(
                depositResult.Transaction.Amount,
                depositResult.Transaction.Description,
                depositResult.Transaction.TransactionDate,
                depositResult.UpdatedBalance
                );

            return(new ObjectResult(model));
        }
Example #19
0
        public async Task <IActionResult> WithDraw(WithdrawModel model)
        {
            ErrorViewModel err = new ErrorViewModel();

            try
            {
                if (ModelState.IsValid)
                {
                    if (model.Amount < 50000 || model.Amount % 50000 != 0)
                    {
                        err.Message = ErrorCode.GetError(ErrorCode.AmountInvalid).Value;
                    }
                    else
                    {
                        var transferResponse = await _clientService.PostAsync <TransferResponse>(URLDefine.withdraw, model);

                        if (transferResponse.Code == 0)
                        {
                            return(RedirectToAction("TransactionDetail", "Transaction", new { TransactionId = transferResponse.Data.TransactionId }));
                        }
                        else
                        {
                            err.Message = transferResponse.Message;
                        }
                    }
                }
                else
                {
                    return(View());
                }
            }
            catch (Exception ex)
            {
                Logger.Error($"Exception: {ex} , Method:WithDraw");
                err.Message = "Lỗi hệ thống";
            }
            return(PartialView("Error", err));
        }
        public void ValidateSucessWithdrawAndTaxWithMovement()
        {
            //testa taxa saque
            RegisteUser("68676183082");
            var depositModel = _dataFake.GetDepositModel("68676183082");

            depositModel.Amount = 150;

            _ = _accountService.Deposit(depositModel).Result;
            var withdrawModel = new WithdrawModel
            {
                Amount   = 100,
                Cpf      = "68676183082",
                Password = "******"
            };

            var tax    = withdrawModel.Amount * (decimal)0.01;
            var result = _accountService.Withdraw(withdrawModel).Result;

            Assert.True(result.Success);
            Assert.Equal(tax, result.Model.Tax);

            ValidateMovement(withdrawModel.Amount, "68676183082", tax);
        }
Example #21
0
        /// <summary>
        /// 审核页面
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Audit(int id)
        {
            var           request   = new WithdrawRequest();
            var           withdraws = withdrawService.GetById(id);
            WithdrawModel model     = new WithdrawModel();

            if (withdraws != null)
            {
                var user = IAccountService.GetByUserId(withdraws.userId); //MembershipService.GetUserById(withdraws.userId);
                model.amount      = withdraws.amount;
                model.DisplayName = user.name;
                //model.Email = "";
                //model.Gender = user.gender;//user.gender==null?0:user.gender;
                //model.Mobile=user.Mobile;
                model.Operator   = withdraws.Operator;
                model.point      = withdraws.point;
                model.remark     = withdraws.remark;
                model.state      = withdraws.state;
                model.submitTime = withdraws.submitTime;
                model.withdrawId = withdraws.withdrawId;
            }
            //var wdith = withdraws.ModelList.Where(x => x.withdrawId == id).FirstOrDefault();
            return(View(new EcardModelItem <WithdrawModel>(model)));
        }
Example #22
0
    //private void GetLeftsxfMoney()
    //{
    //    string sxf = BLL.CommonClass.CommonDataBLL.GetLeftsxfMoney(money.Text);
    //    rmoney.Text = leftMoney;
    //}

    /// <summary>
    /// 绑定用户银行信息
    /// </summary>
    /// <param name="number"></param>
    //public void getBankInfo(string number)
    //{
    //    string sql = "select name,bankname,bankaddress,bankbranchname,bankcard,bankbook,Name from memberinfo m,memberbank mb where m.bankcode=mb.bankcode and number='" + Session["Member"].ToString() + "'";
    //    DataTable dt = DAL.DBHelper.ExecuteDataTable(sql);
    //    if (dt.Rows.Count > 0)
    //    {
    //        Label1.Text = dt.Rows[0]["bankname"].ToString() + dt.Rows[0]["bankbranchname"].ToString();
    //        //Label3.Text = Encryption.Encryption.GetEncryptionCard(dt.Rows[0]["bankcard"].ToString());
    //        Label3.Text = dt.Rows[0]["bankcard"].ToString();
    //        Label2.Text = Encryption.Encryption.GetDecipherName(dt.Rows[0]["name"].ToString());
    //    }
    //    else
    //    {
    //        Label1.Text = GetTran("007674", "未填写");
    //        Label2.Text = GetTran("007674", "未填写");
    //        Label3.Text = GetTran("007674", "未填写");
    //    }
    //}

    //提交保存
    protected void Button1_Click(object sender, EventArgs e)
    {
        ///设置特定值防止重复提交
        hid_fangzhi.Value = "0";


        ///判断会员账户是否被冻结
        if (DAL.MemberInfoDAL.CheckState(Session["Member"].ToString()))
        {
            Page.ClientScript.RegisterStartupScript(GetType(), null, "<script language='javascript'>alert('您的账户被冻结,不能使用提现申请');window.location.href='First.aspx';</script>"); return;
        }


        #region 为空验证
        DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select Name,MobileTele,b.level from memberinfo a ,memberinfobalance1 b where a.number=b.number and a.Number='" + Session["Member"].ToString() + "'");



        double txMoney = 0; //提现金额
        if (!double.TryParse(this.money.Text.Trim(), out txMoney))
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('金额只能是数字!');", true);
            return;
        }
        int level = Convert.ToInt32(dt_one.Rows[0]["level"].ToString());
        if (DropDownList1.SelectedValue == "1")
        {
            //if (txMoney > 60 && level == 3)
            //{
            //    System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('3000配套提现金额不能大于60!');", true);
            //    return;
            //}
            //if (txMoney > 40 && level == 2)
            //{
            //    System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('1000配套提现金额不能大于40!');", true);
            //    return;
            //}
            //if (txMoney > 20 && level == 1)
            //{
            //    System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('500配套提现金额不能大于20!');", true);
            //    return;
            //}
            if (txMoney > 1000)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('提现金额不能大于1000!');", true);
                return;
            }
            //if (txMoney < 20)
            //{
            //    System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('提现金额不能小于20!');", true);
            //    return;
            //}
        }

        string bianhao = Session["Member"].ToString();



        #endregion


        double wyj  = 0;                                                                     //违约金
        double sxf  = 0;                                                                     //手续费
        double xjye = Convert.ToDouble(BLL.CommonClass.CommonDataBLL.GetLeftMoney(bianhao)); //现金账户余额【单位:美元】

        try
        {
            string    hkxz   = " select value from JLparameter where jlcid=5";
            DataTable dthkxz = DAL.DBHelper.ExecuteDataTable(hkxz);
            string    value  = dthkxz.Rows[0]["value"].ToString();

            if (txMoney % 10 != 0)
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('提现金额只能为10的倍数');", true);
                this.money.Text = "";
                return;
            }
            if (RadioButtonList1.SelectedValue == "2")
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('重要提示!提现到商城默认充值到当前账户手机号的商城账户,如未注册商城,系统会稍后自动注册并充值');", true);
            }
        }
        catch (Exception eps)
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert(金额只能是数字');", true);
            return;
        }

        if (this.remark.Text.Length > 500)
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('对不起,备注输入的字符太多,最多500个字符!');", true);
            return;
        }

        object o_one1 = DAL.DBHelper.ExecuteScalar("select value from JLparameter where jlcid=3");
        string value1 = "0";//提现违约金比例
        if (o_one1 != null)
        {
            value1 = o_one1.ToString();
        }

        object o_one2 = DAL.DBHelper.ExecuteScalar("select WithdrawSXF from WithdrawSz");
        string sxfbl  = "0.002";//提现手续费比例
        if (o_one2 != null)
        {
            sxfbl = o_one2.ToString();
        }

        int isjl = 0;

        if (txMoney > xjye)
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('金额超出最大可转金额!');", true);
            return;
        }

        if (txMoney > Convert.ToDouble(Label1.Text.Trim()))
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('金额超出最大可转金额!');", true);
            return;
        }
        isjl = Convert.ToInt32(DropDownList1.SelectedValue);

        WithdrawModel wDraw = new WithdrawModel();
        // wDraw.Number = Session["Member"].ToString();
        wDraw.ApplicationExpecdtNum = BLL.CommonClass.CommonDataBLL.getMaxqishu();

        wDraw.WithdrawMoney = txMoney;
        wDraw.WithdrawTime  = DateTime.Now.ToUniversalTime();
        wDraw.OperateIP     = BLL.CommonClass.CommonDataBLL.OperateIP;
        wDraw.Remark        = this.remark.Text.Trim();
        wDraw.Bankcard      = "";
        wDraw.Bankname      = "";
        wDraw.Wyj           = Convert.ToDouble(RadioButtonList1.SelectedValue); //违约金

        wDraw.WithdrawSXF = 0;                                                  //手续费

        wDraw.IsJL    = isjl;
        wDraw.blmoney = 0;                                           //提现手续费比例
        wDraw.Wyjbl   = 0;                                           //违约金比例
        string HyName     = dt_one.Rows[0]["Name"].ToString();       //订单类型
        string MobileTele = dt_one.Rows[0]["MobileTele"].ToString(); //订单类型
        wDraw.Number   = Session["Member"].ToString();
        wDraw.Bankcard = MobileTele;
        wDraw.Khname   = HyName;
        MemberInfoModel memberinfo = new MemberInfoModel();
        memberinfo.Memberships = Convert.ToDecimal(this.money.Text.Trim());
        memberinfo.Number      = Session["Member"].ToString();

        bool isSure = false;
        if (ViewState["edit"].ToString() == "0")
        {
            //if (DropDownList1.SelectedValue == "1")
            //{
            //    isSure = BLL.Registration_declarations.RegistermemberBLL.WithdrawMoney(wDraw);
            //}
            //else
            //{
            SqlTransaction tran = null;
            SqlConnection  con  = DBHelper.SqlCon();
            try
            {
                con.Open();
                tran = con.BeginTransaction();
                if (!DAL.ECTransferDetailDAL.MemberCash(tran, wDraw))
                {
                    tran.Rollback();
                    System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('提现申请失败!');", true);
                    return;
                }

                string         strSql = "Update MemberInfo Set MemberShip = MemberShip + @Money Where number=@Number";
                SqlParameter[] para1  =
                {
                    new SqlParameter("@Money",  SqlDbType.Money),
                    new SqlParameter("@Number", SqlDbType.NVarChar, 50)
                };
                para1[0].Value = wDraw.WithdrawMoney;
                para1[1].Value = wDraw.Number;
                int count = (int)DBHelper.ExecuteNonQuery(tran, strSql, para1, CommandType.Text);
                if (count == 0)
                {
                    tran.Rollback();
                    isSure = false;
                }


                tran.Commit();
                isSure = true;
            }
            catch
            {
                tran.Rollback();
                isSure = false;
            }
            finally
            {
                con.Close();
            }
            //}
        }
        else
        {
            getOldBind(Session["Member"].ToString());
            wDraw.Id = id;
            //if (BLL.Registration_declarations.RegistermemberBLL.GetAuditState(wDraw.Id) == 3)
            //{
            //    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('该申请单账号错误,不可以修改!');</script>");
            //    return;
            //}
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(wDraw.Id) == 1)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('已提交申请不可以重复提交!');</script>");
                return;
            }

            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(wDraw.Id) == 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('已提交申请不可以重复提交!');</script>");
                return;
            }


            SqlTransaction tran = null;
            SqlConnection  con  = DBHelper.SqlCon();
            try
            {
                con.Open();
                tran = con.BeginTransaction();
                if (!DAL.ECTransferDetailDAL.MemberCash(tran, wDraw))
                {
                    tran.Rollback();
                    System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('提现申请失败!');", true);
                    return;
                }

                string         strSql = "Update MemberInfo Set MemberShip = MemberShip + @Money Where number=@Number";
                SqlParameter[] para1  =
                {
                    new SqlParameter("@Money",  SqlDbType.Money),
                    new SqlParameter("@Number", SqlDbType.NVarChar, 50)
                };
                para1[0].Value = wDraw.WithdrawMoney;
                para1[1].Value = wDraw.Number;
                int count = (int)DBHelper.ExecuteNonQuery(tran, strSql, para1, CommandType.Text);
                if (count == 0)
                {
                    tran.Rollback();
                    isSure = false;
                }


                tran.Commit();
                isSure = true;
            }
            catch
            {
                tran.Rollback();
                isSure = false;
            }
            finally
            {
                con.Close();
            }

            ViewState["edit"] = "0";
            //isSure = BLL.Registration_declarations.RegistermemberBLL.updateWithdraw(wDraw);
        }


        if (isSure)
        {
            if (ViewState["edit"].ToString() == "0")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('提现申请完成!');setInterval('myInterval()',5000);function myInterval(){window.location.href='First.aspx'};</script>", false);
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改成功!');location.href='first.aspx'</script>", false);
            }
            this.money.Text  = "";
            this.remark.Text = "";
        }
        else
        {
            if (ViewState["edit"].ToString() == "0")
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('提现申请失败!');", true);
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改失败!');</script>", false);
            }
        }
    }
Example #23
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string[] args = e.CommandArgument.ToString().Split(',');

        string        numebr      = args[0].ToString();
        string        isAuditing  = args[1].ToString();
        int           id          = Convert.ToInt32(args[2].ToString());
        double        money       = Convert.ToDouble(args[3].ToString());
        double        withdrawSXF = Convert.ToDouble(args[4].ToString());
        double        wyj         = Convert.ToDouble(args[5].ToString());
        int           IsJL        = Convert.ToInt16(args[6].ToString());
        WithdrawModel wDraw       = new WithdrawModel();

        wDraw.Id     = id;
        wDraw.Number = numebr;
        wDraw.ApplicationExpecdtNum = BLL.CommonClass.CommonDataBLL.getMaxqishu();
        wDraw.WithdrawMoney         = money;
        wDraw.WithdrawSXF           = withdrawSXF;
        wDraw.Wyj              = wyj;
        wDraw.AuditExpectNum   = BLL.CommonClass.CommonDataBLL.getMaxqishu();
        wDraw.AuditingIP       = BLL.CommonClass.CommonDataBLL.OperateIP;
        wDraw.AuditingManageId = BLL.CommonClass.CommonDataBLL.OperateBh;
        wDraw.AuditTime        = DateTime.Now.ToUniversalTime();
        wDraw.IsJL             = IsJL;

        if (e.CommandName.ToString() == "Lbtn")
        {
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 2)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007176", "该申请单已经审核,不可以重复审核!") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }

            if (!BLL.Registration_declarations.RegistermemberBLL.isDelMemberCash(id))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007177", "该申请单已经被删除!") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }
            if (wDraw.IsJL != 1)
            {
                double leftMoney = Convert.ToDouble(BLL.CommonClass.CommonDataBLL.GetLeftMoney1(numebr));
                if (money > leftMoney)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007175", "可提现余额不足,不能审核!") + "')</script>");
                    return;
                }
            }
            Application.Lock();
            bool isSure = false;

            isSure = BLL.Registration_declarations.RegistermemberBLL.AuditWithdraw(wDraw);

            Application.UnLock();
            if (isSure)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000858", "审核成功!") + "')</script>");
                this.BtnConfirm_Click(null, null);
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("006041", "审核失败!") + "')</script>");
                return;
            }
        }
        if (e.CommandName == "Del")
        {
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 1)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007174", "该申请单已经审核,不可以删除!") + "');</script>");
                return;
            }
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 3)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007173", "该申请单账号错误,不可以删除!") + "');</script>");
                return;
            }

            if (!BLL.Registration_declarations.RegistermemberBLL.isDelMemberCash(id))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007178", "该申请单已经删除,不可以删除!") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }

            ChangeLogs cl = new ChangeLogs("MemberCash", "ltrim(rtrim(str(id)))");
            cl.AddRecord(wDraw.Id);
            Application.Lock();
            bool isSure = BLL.Registration_declarations.RegistermemberBLL.DeleteWithdraw(wDraw);
            Application.UnLock();
            if (isSure)
            {
                cl.AddRecord(wDraw.Id);
                cl.DeletedIntoLogs(ChangeCategory.company14, Session["Company"].ToString(), ENUM_USERTYPE.objecttype5);

                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000008", "删除成功!)") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000009", "删除失败!)") + "')</script>");
                return;
            }
        }
        //账号错误
        if (e.CommandName == "carderror")
        {
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 2)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007181", "该申请单已经审核,不可以转成账号错误!") + "');</script>");
                return;
            }
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 3)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007180", "该申请单已经是账号错误,不可以重复账号错误!") + "');</script>");
                return;
            }

            if (!BLL.Registration_declarations.RegistermemberBLL.isDelMemberCash(id))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007179", "该申请单已经删除,不可以转成账号错误!") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }

            ChangeLogs cl = new ChangeLogs("MemberCash", "ltrim(rtrim(str(id)))");
            cl.AddRecord(wDraw.Id);
            Application.Lock();
            bool isSure = false;

            isSure = BLL.Registration_declarations.RegistermemberBLL.updateCardEorror(wDraw.Id, wDraw.WithdrawMoney, wDraw.Number);

            Application.UnLock();
            if (isSure)
            {
                cl.AddRecord(wDraw.Id);
                cl.DeletedIntoLogs(ChangeCategory.company14, Session["Company"].ToString(), ENUM_USERTYPE.objecttype5);

                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001401", "操作成功!)") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001541", "操作失败!)") + "')</script>");
                return;
            }
        }
        //开始处理
        if (e.CommandName == "kscl")
        {
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 1)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007182", "该申请单已经审核,不可以在开始处理!") + "');</script>");
                return;
            }
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 2)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007183", "该申请单已经开始处理,不可以在开始处理!") + "');</script>");
                return;
            }
            if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 3)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007184", "该申请单已经是账号错误,不可以在开始处理!") + "');</script>");
                return;
            }

            if (!BLL.Registration_declarations.RegistermemberBLL.isDelMemberCash(id))
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007185", "该申请单已经删除,不可以在开始处理!") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }

            ChangeLogs cl = new ChangeLogs("Withdraw", "ltrim(rtrim(str(id)))");
            cl.AddRecord(wDraw.Id);
            Application.Lock();
            bool isSure = BLL.Registration_declarations.RegistermemberBLL.updateKscl(wDraw.Id);
            Application.UnLock();
            if (isSure)
            {
                cl.AddRecord(wDraw.Id);
                cl.DeletedIntoLogs(ChangeCategory.company14, Session["Company"].ToString(), ENUM_USERTYPE.objecttype5);

                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001401", "操作成功!)") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001541", "操作失败!)") + "')</script>");
                return;
            }
        }
    }
Example #24
0
    /// <summary>
    /// 批量处理
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btn_listsubmit_Click(object sender, EventArgs e)
    {
        try
        {
            int ret = 0;

            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                CheckBox chb = (CheckBox)GridView1.Rows[i].FindControl("chb") as CheckBox;

                LinkButton LinkButton1 = (LinkButton)GridView1.Rows[i].FindControl("LinkButton1") as LinkButton;
                LinkButton LinkButton2 = (LinkButton)GridView1.Rows[i].FindControl("LinkButton2") as LinkButton;
                LinkButton LinkButton3 = (LinkButton)GridView1.Rows[i].FindControl("LinkButton3") as LinkButton;
                string[]   args        = null;
                args = LinkButton1.ToolTip.ToString().Split(',');
                string        numebr     = args[0].ToString();
                string        isAuditing = args[1].ToString();
                int           id         = Convert.ToInt32(args[2].ToString());
                double        money      = Convert.ToDouble(args[3].ToString());
                int           bz         = Convert.ToInt32(args[2].ToString());
                WithdrawModel wDraw      = new WithdrawModel();
                wDraw.Id     = id;
                wDraw.Number = numebr;
                wDraw.ApplicationExpecdtNum = BLL.CommonClass.CommonDataBLL.getMaxqishu();
                wDraw.WithdrawMoney         = money;
                wDraw.AuditExpectNum        = BLL.CommonClass.CommonDataBLL.getMaxqishu();
                wDraw.AuditingIP            = BLL.CommonClass.CommonDataBLL.OperateIP;
                wDraw.AuditingManageId      = BLL.CommonClass.CommonDataBLL.OperateBh;
                wDraw.AuditTime             = DateTime.Now.ToUniversalTime();
                wDraw.Wyj = bz;
                //已汇出
                if (rad_list.SelectedValue == "1" && chb.Checked == true && LinkButton1.Visible == true)
                {
                    if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 2)
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007176", "的该申请单已经审核,不可以重复审核!") + "')</script>");
                        this.BtnConfirm_Click(null, null);
                        break;
                    }

                    if (!BLL.Registration_declarations.RegistermemberBLL.isDelMemberCash(id))
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007177", "该申请单已经被删除!") + "')</script>");
                        this.BtnConfirm_Click(null, null);
                        break;
                    }

                    double leftMoney = Convert.ToDouble(BLL.CommonClass.CommonDataBLL.GetLeftMoney1(numebr));
                    if (money > leftMoney)
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007175", "可提现余额不足,不能审核!") + "')</script>");
                        break;
                    }
                    Application.Lock();
                    bool isSure = false;

                    isSure = BLL.Registration_declarations.RegistermemberBLL.AuditWithdraw(wDraw);

                    Application.UnLock();
                    if (isSure)
                    {
                        ret = 1;
                    }
                    else
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("006041", "审核失败!") + "')</script>");
                        break;
                    }
                }//账户出错
                else if (rad_list.SelectedValue == "2" && chb.Checked == true && LinkButton2.Visible == true)
                {
                    if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 2)
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007181", "该申请单已经审核,不可以转成账号错误!") + "');</script>");
                        break;
                    }
                    if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 3)
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007180", "该申请单已经是账号错误,不可以重复账号错误!") + "');</script>");
                        break;
                    }

                    if (!BLL.Registration_declarations.RegistermemberBLL.isDelMemberCash(id))
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007179", "该申请单已经删除,不可以转成账号错误!") + "')</script>");
                        this.BtnConfirm_Click(null, null);
                        break;
                    }

                    ChangeLogs cl = new ChangeLogs("MemberCash", "ltrim(rtrim(str(id)))");
                    cl.AddRecord(wDraw.Id);
                    Application.Lock();
                    bool isSure = BLL.Registration_declarations.RegistermemberBLL.updateCardEorror(wDraw.Id, wDraw.WithdrawMoney, wDraw.Number);
                    Application.UnLock();
                    if (isSure)
                    {
                        cl.AddRecord(wDraw.Id);
                        cl.DeletedIntoLogs(ChangeCategory.company14, Session["Company"].ToString(), ENUM_USERTYPE.objecttype5);
                        ret = 1;
                    }
                    else
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("001541", "操作失败!)") + "')</script>");
                        break;
                    }
                }//开始处理
                else if (rad_list.SelectedValue == "3" && chb.Checked == true && LinkButton3.Visible == true)
                {
                    if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 1)
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007182", "该申请单已经审核,不可以在开始处理!") + "');</script>");
                        break;
                    }
                    if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 2)
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007183", "该申请单已经开始处理,不可以在开始处理!") + "');</script>");
                        break;
                    }
                    if (BLL.Registration_declarations.RegistermemberBLL.GetMemberCashAuditState(id) == 3)
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007184", "该申请单已经是账号错误,不可以在开始处理!") + "');</script>");
                        break;
                    }

                    if (!BLL.Registration_declarations.RegistermemberBLL.isDelMemberCash(id))
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("007185", "该申请单已经删除,不可以在开始处理!") + "')</script>");
                        this.BtnConfirm_Click(null, null);
                        break;
                    }

                    ChangeLogs cl = new ChangeLogs("MemberCash", "ltrim(rtrim(str(id)))");
                    cl.AddRecord(wDraw.Id);
                    Application.Lock();
                    bool isSure = BLL.Registration_declarations.RegistermemberBLL.updateKscl(wDraw.Id);
                    Application.UnLock();
                    if (isSure)
                    {
                        cl.AddRecord(wDraw.Id);
                        cl.DeletedIntoLogs(ChangeCategory.company14, Session["Company"].ToString(), ENUM_USERTYPE.objecttype5);
                        ret = 1;
                    }
                    else
                    {
                        ret = -1;
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007829", "编号为") + id + GetTran("001541", "操作失败!") + "')</script>");
                        break;
                    }
                }
            }

            if (rad_list.SelectedValue == "1" && ret == 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007834", "选项中没有需要已汇出的选项") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }
            else if (rad_list.SelectedValue == "2" && ret == 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007835", "选项中没有账户错误的选项") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }
            else if (rad_list.SelectedValue == "3" && ret == 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("007836", "选项中没有开始处理的选项") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }

            if (ret > 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001401", "操作成功!") + "')</script>");
                this.BtnConfirm_Click(null, null);
                return;
            }
        }
        catch
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001541", "操作失败!") + "')</script>");
            return;
        }
    }
 public async Task <IResult <WithdrawModel> > Withdraw(WithdrawModel withdrawModel)
 {
     return(await _accountService.Withdraw(withdrawModel));
 }
Example #26
0
 public ListWithdraw(WithdrawModel innerObject)
 {
     _innerObject = innerObject;
 }
Example #27
0
 public ListWithdraw()
 {
     _innerObject = new WithdrawModel();
 }
Example #28
0
 public Task WithdrawRegistrationAsync(Guid competitionId, Guid registrationId, WithdrawModel model, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(PutAsync($"competitions/{competitionId}/registrations/{registrationId}/withdraw", model, cancellationToken));
 }
Example #29
0
    public void getzf()
    {
        string sl = GenerateCheckCodeNum(32);
        //long mony = Convert.ToInt64(money.Text.Trim());



        string postdz = "https://oauth.factorde.com/api/pay/queryOrder";
        Dictionary <String, String> myDi = new Dictionary <String, String>();
        Dictionary <String, Object> da   = new Dictionary <String, Object>
        {
            { "out_trade_no", Session["zfddh"].ToString() }
        };

        String jso = JsonConvert.SerializeObject(da, Formatting.Indented);

        myDi.Add("nonce_str", sl);
        myDi.Add("biz_content", jso);
        myDi.Add("app_id", PublicClass.app_id);
        myDi.Add("access_token", Session["access_token"].ToString());
        myDi.Add("lang", "zh_CN");
        myDi.Add("version", "1.0");
        myDi.Add("charset", "utf8");
        myDi.Add("openid", Session["Member"].ToString());

        string signj = PublicClass.GetSignContent(myDi);
        string jsonS = PublicClass.HmacSHA256(signj + "&key=cd310d4c38d3b27dd9dfc069e559f73f", "cd310d4c38d3b27dd9dfc069e559f73f");

        myDi.Add("sign", jsonS);

        string  rspp   = PublicClass.doHttpPost(postdz, myDi);
        JObject stJson = JObject.Parse(rspp);
        // money.Text = rspp;
        string zt   = stJson["data"]["trade_status"].ToString();
        int    skje = Convert.ToInt32(stJson["data"]["settle_trans_amount"]);

        if (zt == "SUCCESS")
        {
            SqlTransaction tran = null;
            SqlConnection  conn = DAL.DBHelper.SqlCon();
            conn.Open();
            tran = conn.BeginTransaction();
            try
            {
                int    ret = 0;
                string sql = "update memberinfo set Jackpot=Jackpot+" + skje + " where number='" + Session["Member"].ToString() + "'";
                int    cg  = DBHelper.ExecuteNonQuery(tran, sql);

                ret = DBHelper.ExecuteNonQuery(tran, "INSERT INTO MemberAccount(Number,HappenTime,HappenMoney,BalanceMoney,Direction,SfType,KmType,Remark)SELECT j.number,GETutcDATE()," + skje + " ,j.Jackpot-j.Out,0,1,2,'成功充值USDT" + skje + "'from memberinfo j WHERE j.Number='" + Session["Member"].ToString() + "'");

                if (cg > 0 && ret > 0)
                {
                    tran.Commit();
                    conn.Close();
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('充值申请成功,已经到账请查收,如没到账请联系客服。');</script>", false);
                }
                else
                {
                    tran.Rollback();
                    conn.Close();
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('充值失败1!');</script>");
                }
            }
            catch (Exception)
            {
                conn.Close();
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('充值失败2!');</script>");
            }


            Session["zfddh"] = "";
            this.money.Text  = "";
            this.remark.Text = "";
        }
        else
        {
            WithdrawModel wDraw = new WithdrawModel();
            wDraw.Number                = Session["Member"].ToString();
            wDraw.WithdrawMoney         = Convert.ToDouble(Session["ddje"].ToString()); //兑换金额
            wDraw.WithdrawSXF           = Convert.ToDouble(Session["ddje"].ToString()); //兑换总额
            wDraw.WithdrawTime          = DateTime.Now;                                 //时间
            wDraw.Remark                = ddbh;                                         //备注
            wDraw.ApplicationExpecdtNum = 0;                                            //状态


            DataTable dt_one = DAL.DBHelper.ExecuteDataTable("select MobileTele from memberinfo where Number='" + Session["Member"].ToString() + "'");
            string    ipn    = dt_one.Rows[0]["MobileTele"].ToString();
            wDraw.OperateIP = ipn;



            //wDraw.Khname = HyName;

            MemberInfoModel memberinfo = new MemberInfoModel();
            // memberinfo.Memberships = Convert.ToDecimal(this.HiddenField1.Value) + Convert.ToDecimal(this.money.Text.Trim());
            memberinfo.Number = Session["Member"].ToString();

            bool isSure = false;



            isSure = BLL.Registration_declarations.RegistermemberBLL.XFMoney(wDraw);
            // D_AccountBLL.AddAccountWithdraw(memberinfo.Number, Convert.ToDouble(Session["ddje"].ToString()), D_AccountSftype.MemberType, D_Sftype.BounsAccount, D_AccountKmtype.RechargeByManager, DirectionEnum.AccountsIncreased, "申请充值可用FTC,增加FTC:" + Convert.ToDouble(Session["ddje"].ToString()) + "");
            if (isSure)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('充值申请成功,等待审核。');</script>", false);
                Session["zfddh"] = "";
                this.money.Text  = "";
                this.remark.Text = "";
            }
            else
            {
                System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('充值申请失败,请重新提交。');", true);
            }
        }
    }