Ejemplo n.º 1
0
    private int Comparison(InvestmentUsersPlans x, InvestmentUsersPlans y)
    {
        var plan1 = new InvestmentPlatformPlan(x.PlanId);
        var plan2 = new InvestmentPlatformPlan(y.PlanId);

        return(plan1.Number < plan2.Number ? -1 : 1);
    }
Ejemplo n.º 2
0
 public HtmlInvestmentProofGenerator(InvestmentUsersPlans userPlan)
 {
     this.userPlan = userPlan;
     user          = new Member(userPlan.UserId);
     fileName      = string.Format("{0}.pdf", userPlan.GeneratePlanNumber());
     platformPlan  = new InvestmentPlatformPlan(userPlan.PlanId);
 }
Ejemplo n.º 3
0
    protected void HistoryGridView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "download")
        {
            int         index = e.GetSelectedRowIndex() % HistoryGridView.PageSize;
            GridViewRow row   = HistoryGridView.Rows[index];
            var         plan  = new InvestmentUsersPlans(Convert.ToInt32(row.Cells[0].Text.Trim()));

            var proof = new HtmlInvestmentProofGenerator(plan);
            proof.DownloadPdf();
        }
    }
Ejemplo n.º 4
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;
        }
    }
Ejemplo n.º 5
0
    private UserControl GetAdHTML(InvestmentPlatformPlan plan, bool includedUsersEarning = false, InvestmentUsersPlans userPlan = null)
    {
        var objControl    = (UserControl)Page.LoadControl("~/Controls/InvestmentPlatform/InvestmentPlanDetails.ascx");
        var parsedControl = objControl as IInvestmentPlanObjectControl;

        parsedControl.PlatformPlan = plan;

        if (includedUsersEarning)
        {
            parsedControl.IncludedUsersEarning = includedUsersEarning;
            parsedControl.UserPlan             = userPlan;
        }

        parsedControl.DataBind();

        return((UserControl)parsedControl);
    }