コード例 #1
0
        protected void GoalViewEditByGoalId(int goalId, string goalAction, string goalCategory)
        {
            goalPlanningVo      = goalPlanningBo.GetGoalDetails(goalId);
            ViewState["GoalId"] = goalId;
            if (goalCategory == "NonRT")
            {
                //rtbNonRT.Checked = true;
                //rtbRT.Checked = false;
                btnNonRTSave.Visible   = false;
                btnRTUpdate.Visible    = false;
                btnNonRTUpdate.Visible = true;


                if (goalPlanningVo != null)
                {
                    ddlGoalType.SelectedValue = goalPlanningVo.Goalcode;
                    txtGoalDescription.Text   = goalPlanningVo.GoalDescription;
                    //txtGoalDate.Text = goalPlanningVo.GoalProfileDate.ToShortDateString();
                    ddlPriority.SelectedValue = goalPlanningVo.Priority;
                    if (goalPlanningVo.IsOnetimeOccurence == true)
                    {
                        ddlOccurrence.SelectedValue = "Once";
                    }
                    else
                    {
                        ddlOccurrence.SelectedValue = "Recurring";
                        trFrequency.Visible         = true;
                        ddlFrequency.SelectedValue  = goalPlanningVo.Frequency.Trim();
                    }

                    ddlGoalYear.SelectedValue = goalPlanningVo.GoalYear.ToString();
                    txtGoalCostToday.Text     = goalPlanningVo.CostOfGoalToday.ToString();
                    txtComment.Text           = goalPlanningVo.Comments;
                    if (goalAction == "Edit")
                    {
                        SetControlReadOnly(false);
                    }
                    else if (goalAction == "View")
                    {
                        SetControlReadOnly(true);
                    }
                }
            }
            else if (goalCategory == "RT")
            {
                if (goalPlanningVo != null)
                {
                    ddlGoalType.SelectedValue      = goalPlanningVo.Goalcode;
                    txtRTGoalCostToday.Text        = goalPlanningVo.CostOfGoalToday.ToString();
                    txtRTCorpusToBeLeftBehind.Text = goalPlanningVo.CorpusLeftBehind.ToString();

                    if (goalAction == "Edit")
                    {
                        SetControlReadOnly(false);
                    }
                    else if (goalAction == "View")
                    {
                        SetControlReadOnly(true);
                    }

                    PnlNonRetirement.Visible = false;
                    PnlRetirement.Visible    = true;
                }
                //rtbRT.Checked = true;
                //rtbNonRT.Checked = false;
                btnRTSave.Visible      = false;
                btnRTUpdate.Visible    = true;
                btnNonRTUpdate.Visible = false;
            }

            //rtbRT.Enabled = false;
            //rtbNonRT.Enabled = false;
        }
コード例 #2
0
        protected void ShowGoalDetails(CustomerGoalFundingProgressVo customerGoalFundingProgressVo, CustomerGoalPlanningVo goalPlanningVo)
        {
            if (goalPlanningVo != null)
            {
                if (goalPlanningVo.GoalName != null)
                {
                    txtGoalName.Text = goalPlanningVo.GoalName.Trim();
                }
                if (goalPlanningVo.GoalProfileDate != DateTime.MinValue)
                {
                    txtStartDate.Text = goalPlanningVo.GoalProfileDate.Year.ToString();
                }
                txtTargetDate.Text      = goalPlanningVo.GoalYear.ToString();
                txtGoalAmount.Text      = String.Format("{0:n2}", Math.Round(goalPlanningVo.FutureValueOfCostToday, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")));
                txtTenureCompleted.Text = (DateTime.Now.Year - goalPlanningVo.GoalProfileDate.Year).ToString();
                txtBalanceTenor.Text    = (goalPlanningVo.GoalYear - DateTime.Now.Year).ToString();
                txtCostAtBeginning.Text = String.Format("{0:n2}", Math.Round(goalPlanningVo.CostOfGoalToday, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")));
            }

            if (customerGoalFundingProgressVo != null)
            {
                txtAmountInvested.Text                = customerGoalFundingProgressVo.AmountInvestedTillDate != 0 ? String.Format("{0:n2}", Math.Round(customerGoalFundingProgressVo.AmountInvestedTillDate, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))) : "0";
                txtMonthlyContribution.Text           = customerGoalFundingProgressVo.MonthlyContribution != 0 ? String.Format("{0:n2}", Math.Round(customerGoalFundingProgressVo.MonthlyContribution, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))) : "0";
                txtEstmdTimeToReachGoal.Text          = customerGoalFundingProgressVo.GEstimatedTimeToAchiveGoal != "" ? customerGoalFundingProgressVo.GEstimatedTimeToAchiveGoal : "0";
                txtReturnsXIRR.Text                   = customerGoalFundingProgressVo.ReturnsXIRR != 0 ? String.Format("{0:n2}", Math.Round(customerGoalFundingProgressVo.ReturnsXIRR, 2).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))) : "0";
                txtValueOfCurrentGoal.Text            = customerGoalFundingProgressVo.GoalCurrentValue != 0 ? String.Format("{0:n2}", Math.Round(customerGoalFundingProgressVo.GoalCurrentValue, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))) : "0";
                txtProjectedGap.Text                  = customerGoalFundingProgressVo.ProjectedGapValue != 0 ? String.Format("{0:n2}", Math.Round(customerGoalFundingProgressVo.ProjectedGapValue, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))) : "0";
                txtProjectedValueOnGoalDate.Text      = customerGoalFundingProgressVo.ProjectedValue != 0 ? String.Format("{0:n2}", Math.Round(customerGoalFundingProgressVo.ProjectedValue, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))) : "0";
                txtAdditionalInvestmentsRequired.Text = customerGoalFundingProgressVo.AdditionalMonthlyRequirement != 0 ? String.Format("{0:n2}", Math.Round(customerGoalFundingProgressVo.AdditionalMonthlyRequirement, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))) : "0";
                txtAdditionalInvestments.Text         = customerGoalFundingProgressVo.AdditionalYearlyRequirement != 0 ? String.Format("{0:n2}", Math.Round(customerGoalFundingProgressVo.AdditionalYearlyRequirement, 0).ToString("#,#", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"))) : "0";
            }
        }