Exemplo n.º 1
0
        public object GetCapital()
        {
            CheckUserLogin();
            var capital         = MemberCapitalApplication.GetCapitalInfo(CurrentUser.Id);
            var sitesetting     = SiteSettingApplication.SiteSettings;
            var redPacketAmount = 0M;

            if (capital != null)
            {
                //redPacketAmount = capital.Mall_CapitalDetail.Where(e => e.SourceType == Mall.Model.CapitalDetailInfo.CapitalDetailType.RedPacket).Sum(e => e.Amount);
                redPacketAmount = MemberCapitalApplication.GetSumRedPacket(capital.Id);
            }
            else
            {
                capital = new CapitalInfo();
            }
            bool canWithDraw = MemberApplication.CanWithdraw(CurrentUser.Id);

            return(Json(new
            {
                success = true,
                Balance = capital?.Balance ?? 0,
                RedPacketAmount = redPacketAmount,
                PresentAmount = capital?.PresentAmount ?? 0,
                ChargeAmount = capital?.ChargeAmount ?? 0,
                WithDrawMinimum = sitesetting.WithDrawMinimum,
                WithDrawMaximum = sitesetting.WithDrawMaximum,
                canWithDraw = canWithDraw,
                isOpen = sitesetting.IsOpenRechargePresent,
                rule = RechargePresentRuleApplication.GetRules()
            }));
        }
Exemplo n.º 2
0
        // GET: Web/UserCapital
        public ActionResult Index()
        {
            var capitalService = _iMemberCapitalService;
            var model          = MemberCapitalApplication.GetCapitalInfo(CurrentUser.Id);

            ViewBag.Keyword     = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword;
            ViewBag.Keywords    = SiteSettings.HotKeyWords;
            ViewBag.CanWithDraw = MemberApplication.CanWithdraw(CurrentUser.Id);
            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult CapitalCharge()
        {
            UserCapitalChargeModel result = new UserCapitalChargeModel();
            var model = MemberCapitalApplication.GetCapitalInfo(CurrentUser.Id);

            ViewBag.Keyword                = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword;
            ViewBag.Keywords               = SiteSettings.HotKeyWords;
            result.UserCaptialInfo         = model ?? new Entities.CapitalInfo();
            result.CanWithdraw             = MemberApplication.CanWithdraw(CurrentUser.Id);
            result.IsEnableRechargePresent = SiteSettings.IsOpenRechargePresent;

            if (result.IsEnableRechargePresent)
            {
                result.RechargePresentRules = RechargePresentRuleApplication.GetRules();
            }
            return(View(result));
        }
Exemplo n.º 4
0
        // GET: Mobile/Capital
        public ActionResult Index()
        {
            CapitalIndexChargeModel result = new CapitalIndexChargeModel();

            //判断是否需要跳转到支付地址
            if (this.Request.Url.AbsolutePath.EndsWith("/Capital/Index", StringComparison.OrdinalIgnoreCase) || this.Request.Url.AbsolutePath.EndsWith("/Capital", StringComparison.OrdinalIgnoreCase))
            {
                return(Redirect(Url.RouteUrl("PayRoute") + "?area=mobile&platform=" + this.PlatformType.ToString() + "&controller=Capital&action=Index"));
            }

            var model           = MemberCapitalApplication.GetCapitalInfo(CurrentUser.Id);
            var redPacketAmount = 0M;

            if (model != null)
            {
                //redPacketAmount = model.Himall_CapitalDetail.Where(e => e.SourceType == Model.CapitalDetailInfo.CapitalDetailType.RedPacket).Sum(e => e.Amount);
                redPacketAmount       = MemberCapitalApplication.GetSumRedPacket(model.Id);
                result.CapitalDetails = MemberCapitalApplication.GetTopCapitalDetailList(model.Id, 15);
            }
            else
            {
                model = new CapitalInfo
                {
                    Balance       = 0,
                    ChargeAmount  = 0,
                    FreezeAmount  = 0,
                    MemId         = CurrentUser.Id,
                    PresentAmount = 0
                };
            }
            result.UserCaptialInfo         = model;
            result.IsEnableRechargePresent = SiteSettings.IsOpenRechargePresent;
            if (result.IsEnableRechargePresent)
            {
                result.RechargePresentRules = RechargePresentRuleApplication.GetRules();
            }

            result.RedPacketAmount = redPacketAmount;
            result.IsSetPwd        = string.IsNullOrWhiteSpace(CurrentUser.PayPwd) ? false : true;
            var siteSetting = SiteSettingApplication.SiteSettings;

            result.WithDrawMinimum = siteSetting.WithDrawMinimum;
            result.WithDrawMaximum = siteSetting.WithDrawMaximum;
            result.CanWithDraw     = MemberApplication.CanWithdraw(CurrentUser.Id);
            return(View(result));
        }