Ejemplo n.º 1
0
        protected void LoadPortFolioDetails()
        {
            lblRiskProfile.Text = strProfileName;

            PortFolioModellingDAO portFolioDAO = new PortFolioModellingDAO();
            DataTable dtPortFolioMaster = portFolioDAO.getPortFolioMaster(caseID);

            if ((dtPortFolioMaster == null || dtPortFolioMaster.Rows.Count == 0) && strProfileName == "Capital Preservation")
            {
                EnableDisableControls(false);
                btnBackFundPlotter.Enabled = true;
                btnNextFundPlotter.Enabled = true;
                btnBackPortFolioModel.Enabled = true;
                btnNextPortFolioModel.Enabled = true;
                btnPrintRiskPlotter.Enabled = true;
                btnPrint.Enabled = true;

                optnAgreeRiskProfile.Enabled = true;
                imgRangeOfReturns.ImageUrl = string.Empty;

                return;
            }

            if (dtPortFolioMaster != null && dtPortFolioMaster.Rows.Count > 0)
            {
                lblRiskProfile.Text = dtPortFolioMaster.Rows[0]["riskProfileName"].ToString();

                bool agreeWithRiskProfile = (bool)dtPortFolioMaster.Rows[0]["agreeWithRiskProfile"];
                if (agreeWithRiskProfile)
                {
                    optnAgreeRiskProfileYes.Selected = true;
                }
                else
                {
                    optnAgreeRiskProfileNo.Selected = true;
                }
                optnAgreeRiskProfile_SelectedIndexChanged(null, null);
                if (optnAgreeRiskProfileYes.Selected == true && lblRiskProfile.Text == "Capital Preservation")
                {
                    return;
                }

                ddlRiskProfileList.SelectedValue = dtPortFolioMaster.Rows[0]["preferredRiskPRofile"].ToString();
                if (optnAgreeRiskProfileNo.Selected == true && ddlRiskProfileList.SelectedIndex == 1)
                {
                    ddlRiskProfileList_SelectedIndexChanged(null, null);
                }

                if (optnAgreeRiskProfileYes.Selected == true || (optnAgreeRiskProfileNo.Selected == true && ddlRiskProfileList.SelectedIndex != 1))
                {
                    bool farp = (bool)dtPortFolioMaster.Rows[0]["followAssetAllocationOnRiskProfileYesNo"];
                    if (farp)
                    {
                        optnAssetAllocRiskProfile1.Selected = true;
                    }
                    else
                    {
                        optnAssetAllocRiskProfile2.Selected = true;
                    }
                    followAllocationBasedOnRiskProfile_SelectedIndexChanged(null, null);

                    if (!farp)
                    {
                        //True = Fund Risk Plottor, False = Fund Selection
                        bool arp = (bool)dtPortFolioMaster.Rows[0]["assetAllocationOnRiskProfileYesNo"];
                        if (arp)
                        {
                            optnAllocRiskProfile1.Selected = true;
                        }
                        else
                        {
                            optnAllocRiskProfile2.Selected = true;
                        }

                        onAllocationBasedOnRiskProfile_SelectedIndexChanged(null, null);
                    }

                    if (farp)
                    {
                        bool ncf = (bool)dtPortFolioMaster.Rows[0]["includeNonCoreFundsYesNo"];
                        if (ncf)
                        {
                            optnNonCoreFunds1.Selected = true;
                        }
                        else
                        {
                            optnNonCoreFunds2.Selected = true;
                        }

                        nonCoreFunds_SelectedIndexChanged(null, null);
                    }

                    string pselect = dtPortFolioMaster.Rows[0]["premiumSelect"].ToString().Trim();
                    if (pselect == "0")
                    {
                        optnPremiumSelect1.Selected = true;
                    }
                    else
                    {
                        optnPremiumSelect2.Selected = true;
                    }
                }

                premium.Text = dtPortFolioMaster.Rows[0]["premiumAmount"].ToString();

                ddlPaymentMode.SelectedValue = dtPortFolioMaster.Rows[0]["paymentMode"].ToString();
                premiumSelect_SelectedIndexChanged(null, null);

                txtTotalPremium.Text = dtPortFolioMaster.Rows[0]["premiumPercent"].ToString();
                txtAllocationAmtTotal.Text = dtPortFolioMaster.Rows[0]["premiumTotalAmount"].ToString();

            }

            ShowRateOfReturnsImage();
        }