Example #1
0
    private void InitManageViewControls()
    {
        //TO DO LATER
        //WithdrawAllMoneyFromSystem.Visible = !AppSettings.InvestmentPlatform.InvestmentPlatformDailyLimitsEnabled;
        UserPlanDetailsPlaceHolder.Controls.Clear();

        InformationLiteral.Text = string.Format("{0}: {1}", U6006.MINAMOUNTTOPAYOUT, User.Membership.InvestmentPlatformMinAmountToCredited);
        MoneyInSystemLabel.Text = string.Format("{0}: {1}", U6006.MONEYINSYSTEM, InvestmentUsersPlans.GetMoneyInSystemFromFinishedPlans(User.Id));

        var userPlans = InvestmentPlatformManager.GetUserActivePlans(User.Id);

        if (userPlans.Count > 0)
        {
            NoPlansPlaceHolder.Visible   = false;
            InformationPanel.Visible     = true;
            UsersPlanPlaceHolder.Visible = true;

            if (AppSettings.InvestmentPlatform.InvestmentPlatformPlansPolicy == PlansPolicy.OneUpgradedPlan)
            {
                var currentPlan = new InvestmentPlatformPlan(userPlans[0].PlanId);
                UserPlanDetailsPlaceHolder.Controls.Add(GetAdHTML(currentPlan, true, userPlans[0]));
                ManageDescription.Text = string.Format("{0}:", U6006.YOURPLAN);
            }
            else
            {
                userPlans.Sort(Comparison);

                foreach (var plan in userPlans)
                {
                    var mainPlan = new InvestmentPlatformPlan(plan.PlanId);
                    UserPlanDetailsPlaceHolder.Controls.Add(GetAdHTML(mainPlan, true, plan));
                }

                ManageDescription.Text = string.Format("{0}s:", U6006.YOURPLAN);
            }
        }
        else
        {
            InformationPanel.Visible     = false;
            UsersPlanPlaceHolder.Visible = false;
            NoPlansPlaceHolder.Visible   = true;
            NoPlansLabel.Text            = U6006.YOUDONTHAVEANYPLAN;
        }
    }
Example #2
0
    private void InitPlans()
    {
        switch (CurrentMode)
        {
        case InvestmentPlatformMode.Standard:
            InvestmentPlatformPlaceHolder.Visible = true;
            InvestmentsPlansPlaceHolder.Controls.Clear();

            if (availablePlans.Count == 0)
            {
                NoContetntPlaceHolder.Visible         = true;
                BuyOptionsPlaceHolder.Visible         = false;
                InvestmentPlatformPlaceHolder.Visible = false;
                NoContentLiteral.Text = U6011.NOINVESTMENTPLANS;
                return;
            }

            userActivePlans = InvestmentPlatformManager.GetUserActivePlans(User.Id);
            var isUpgrade = AppSettings.InvestmentPlatform.InvestmentPlatformPlansPolicy == PlansPolicy.OneUpgradedPlan && userActivePlans.Count > 0;

            if (isUpgrade)
            {
                PurchaseDescriptionLabel.Text = U6011.PLANUPGRADE;
            }
            else
            {
                PurchaseDescriptionLabel.Text = U6011.PLANBUY;
            }

            foreach (var plan in availablePlans)
            {
                InvestmentsPlansPlaceHolder.Controls.Add(GetAdHTML(plan));
            }
            break;

        case InvestmentPlatformMode.Levels:
            LevelsPlaceHolder.Visible = true;
            break;
        }
    }
Example #3
0
    //TO DO
    protected void WithdrawAllMoneyFromSystem_Click(object sender, EventArgs e)
    {
        try
        {
            var userPlans = InvestmentPlatformManager.GetUserActivePlans(User.Id);

            foreach (var plan in userPlans)
            {
                plan.TryToWidthdrawlMoneyFromSystem(true);
            }

            SuccessPanel.Visible    = true;
            SuccessTextLiteral.Text = U6010.INVPLATFORMMASSTRANSFERSUCCESS;
        }
        catch (MsgException mex)
        {
            ErrorPanel.Visible    = true;
            ErrorTextLiteral.Text = mex.Message;
        }
        catch (Exception ex)
        {
            ErrorLogger.Log(ex);
        }
    }