/// <summary>
        /// 提现申请数据提交
        /// </summary>
        /// <returns></returns>
        public JsonResult ApplyWithDrawSubmit(string pluginId, string destination, string code, decimal amount, int WithdrawType)
        {
            int result = MemberApplication.CheckCode(pluginId, code, destination, CurrentUser.Id);

            if (result > 0)
            {
                Himall.DTO.ShopWithDraw model = new ShopWithDraw()
                {
                    SellerId         = CurrentUser.Id,
                    SellerName       = CurrentUser.UserName,
                    ShopId           = CurrentSellerManager.ShopId,
                    WithdrawalAmount = amount,
                    WithdrawType     = (Himall.CommonModel.WithdrawType)WithdrawType
                };

                bool isbool = BillingApplication.ShopApplyWithDraw(model);

                if (isbool)
                {
                    return(Json(new { success = true, msg = "成功!" }));
                }
                else
                {
                    return(Json(new { success = false, msg = "余额不足,无法提现!" }));
                }
            }
            else
            {
                return(Json(new { success = false, msg = "验证码错误!" }));
            }
        }
Beispiel #2
0
        public JsonResult verificationCode(string pluginId, string code)
        {
            long uid = ShopApplication.GetShopManagers(CurrentSellerManager.ShopId);

            Himall.DTO.MemberAccountSafety mMemberAccountSafety = MemberApplication.GetMemberAccountSafety(uid);
            string destination = "";

            if (pluginId.Equals("Himall.Plugin.Message.Email"))
            {
                destination = mMemberAccountSafety.Email;
            }
            else
            {
                destination = mMemberAccountSafety.Phone;
            }

            int result = MemberApplication.CheckCode(pluginId, code, destination, uid);

            if (result > 0)
            {
                return(Json(new Result()
                {
                    success = true
                }));
            }
            else
            {
                return(Json(new Result()
                {
                    success = false
                }));
            }
        }
        /// <summary>
        /// 提现申请数据提交
        /// </summary>
        /// <returns></returns>
        public JsonResult ApplyWithDrawSubmit(string pluginId, string destination, string code, decimal amount, int WithdrawType, string Account, string AccountName)
        {
            long userId = MemberApplication.GetMemberUserIdOrShop(CurrentUser, CurrentSellerManager);
            int  result = MemberApplication.CheckCode(pluginId, code, destination, userId);

            if (result > 0)
            {
                var sitesetting = SiteSettingApplication.SiteSettings;
                if (amount <= sitesetting.ShopWithDrawMinimum && amount >= sitesetting.ShopWithDrawMaximum)
                {
                    return(Json(new { success = false, msg = "提现金额不能小于:" + sitesetting.ShopWithDrawMinimum + " 元,不能大于:" + sitesetting.ShopWithDrawMaximum + " 元" }));
                }
                Himall.DTO.ShopWithDraw model = new ShopWithDraw()
                {
                    SellerId         = userId,
                    SellerName       = CurrentSellerManager.UserName,
                    ShopId           = CurrentSellerManager.ShopId,
                    WithdrawalAmount = amount,
                    WithdrawType     = (Himall.CommonModel.WithdrawType)WithdrawType,
                    Account          = Account,
                    AccountName      = AccountName
                };
                if (model.WithdrawType == CommonModel.WithdrawType.ALipay)
                {
                    if (string.IsNullOrEmpty(model.Account) || string.IsNullOrEmpty(model.AccountName))
                    {
                        return(Json(new { success = false, msg = "支付宝提现请填写支付账号与真实姓名!" }));
                    }
                }

                bool isbool = BillingApplication.ShopApplyWithDraw(model);

                if (isbool)
                {
                    return(Json(new { success = true, msg = "成功!" }));
                }
                else
                {
                    return(Json(new { success = false, msg = "余额不足,无法提现!" }));
                }
            }
            else
            {
                return(Json(new { success = false, msg = "验证码错误!" }));
            }
        }