protected void ddlAssetIC_SelectedIndexChanged(object sender, EventArgs e) { DataSet dsAccounts = new DataSet(); CustomerAccountBo custAccBo = new CustomerAccountBo(); try { dsAccounts = custAccBo.GetCustomerCashSavingsAccounts(customerVo.CustomerId, assetGroupCode, ddlAssetIC.SelectedValue); if (dsAccounts.Tables[0].Rows.Count > 0) { ddlAccountID.DataSource = dsAccounts.Tables[0]; ddlAccountID.DataTextField = "CCSA_AccountNum"; ddlAccountID.DataValueField = "CCSA_AccountId"; ddlAccountID.DataBind(); ddlAccountID.Items.Insert(0, "Select an Account"); } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "PortfolioCashSavingsEdit.ascx:ddlAssetIC_SelectedIndexChanged()"); object[] objects = new object[2]; objects[0] = customerVo; objects[1] = assetGroupCode; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
private void BindDetails() { // Get the Portfolio ID from Session' try { customerVo = (CustomerVo)Session["CustomerVo"]; customerId = customerVo.CustomerId; CashSavingsVo = new CashAndSavingsVo(); int CashSavingsPortfolioId = Int32.Parse(Session["CashSavingsPortfolioId"].ToString()); CashSavingsVo = CashSavingsBo.GetSpecificCashSavings(CashSavingsPortfolioId, customerId); if (CashSavingsVo != null) { ddlAssetIC.SelectedValue = CashSavingsVo.AssetInstrumentCategoryCode.ToString(); //.Trim() DataSet dsAccounts = new DataSet(); CustomerAccountBo custAccBo = new CustomerAccountBo(); dsAccounts = custAccBo.GetCustomerCashSavingsAccounts(customerVo.CustomerId, assetGroupCode, ddlAssetIC.SelectedValue); if (dsAccounts.Tables[0].Rows.Count > 0) { ddlAccountID.DataSource = dsAccounts.Tables[0]; ddlAccountID.DataTextField = "CCSA_AccountNum"; ddlAccountID.DataValueField = "CCSA_AccountId"; ddlAccountID.DataBind(); ddlAccountID.Items.Insert(0, "Select an Account"); } ddlAccountID.SelectedValue = CashSavingsVo.AccountId.ToString(); // .Trim() txtName.Text = CashSavingsVo.Name.ToString().Trim(); txtDepositAmount.Text = CashSavingsVo.DepositAmount.ToString().Trim(); txtDepositDate.Text = CashSavingsVo.DepositDate.ToShortDateString().Trim(); txtCurrentValue.Text = CashSavingsVo.CurrentValue.ToString().Trim(); txtInterestRate.Text = CashSavingsVo.InterestRate.ToString().Trim(); ddlDebtIssuer.SelectedValue = CashSavingsVo.DebtIssuerCode.ToString().Trim(); // ddlInterestBasis.SelectedValue = CashSavingsVo.InterestBasisCode.ToString().Trim(); // if (CashSavingsVo.InterestBasisCode.Trim() == "CI") { trCIFrequency.Visible = true; ddlCIFrequency.SelectedValue = CashSavingsVo.CompoundInterestFrequencyCode.ToString().Trim(); } else { trCIFrequency.Visible = false; } if (CashSavingsVo.IsInterestAccumalated == 0) { rbtnInterestAccumYes.Checked = false; rbtnInterestAccumNo.Checked = true; trIA.Visible = false; trIP.Visible = true; trIPFrequency.Visible = true; txtInterestAmtPaidOut.Text = CashSavingsVo.InterestAmntPaidOut.ToString().Trim(); ddlIPFrequency.SelectedValue = CashSavingsVo.InterestPayoutFrequencyCode.ToString().Trim(); } else if (CashSavingsVo.IsInterestAccumalated == 1) { rbtnInterestAccumYes.Checked = true; rbtnInterestAccumNo.Checked = false; trIA.Visible = true; trIP.Visible = false; trIPFrequency.Visible = false; txtInterestAmtAccumulated.Text = CashSavingsVo.InterestAmntAccumulated.ToString().Trim(); } else { trIA.Visible = false; trIP.Visible = false; trIPFrequency.Visible = false; } } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "PortfolioCashSavingsEdit.ascx.cs:BindDetails()"); object[] objects = new object[3]; objects[0] = CashSavingsVo; objects[1] = customerVo; objects[2] = customerId; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }