/// <summary> /// Load mode of holding dropdown /// </summary> /// <param name="path"></param> public void LoadModeOfHolding(string path) { try { DataTable dtModeOfHolding = XMLBo.GetModeOfHolding(path); ddlModeOfHolding.DataSource = dtModeOfHolding; ddlModeOfHolding.DataTextField = "ModeOfHolding"; ddlModeOfHolding.DataValueField = "ModeOfHoldingCode"; ddlModeOfHolding.DataBind(); ddlModeOfHolding.Items.Insert(0, new ListItem("Select a Mode of Holding", "0")); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "PortfolioGovtSavingsEntry.ascx:LoadModeOfHolding()"); object[] objects = new object[1]; objects[0] = path; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
private void BindModeOfHolding() { dtModeOfHolding = XMLBo.GetModeOfHolding(path); ddlModeOfHolding.DataSource = dtModeOfHolding; ddlModeOfHolding.DataTextField = "ModeOfHolding"; ddlModeOfHolding.DataValueField = "ModeOfHoldingCode"; ddlModeOfHolding.DataBind(); ddlModeOfHolding.Items.Insert(0, new ListItem("Select Mode of Holding", "Select Mode of Holding")); }
private void BindDropDowns(string path) { try { dtAccountType = XMLBo.GetBankAccountTypes(path); ddlAccountType.DataSource = dtAccountType; ddlAccountType.DataTextField = "BankAccountType"; ddlAccountType.DataValueField = "BankAccountTypeCode"; ddlAccountType.DataBind(); ddlAccountType.Items.Insert(0, new ListItem("Select an Account Type", "Select an Account Type")); dtModeofOperation = XMLBo.GetModeOfHolding(path); ddlModeOfOperation.DataSource = dtModeofOperation; ddlModeOfOperation.DataTextField = "ModeOfHolding"; ddlModeOfOperation.DataValueField = "ModeOfHoldingCode"; ddlModeOfOperation.DataBind(); ddlModeOfOperation.Items.Insert(0, new ListItem("Select a Mode of Holding", "Select a Mode of Holding")); dtStates = XMLBo.GetStates(path); ddlBankAdrState.DataSource = dtStates; ddlBankAdrState.DataTextField = "StateName"; ddlBankAdrState.DataValueField = "StateCode"; ddlBankAdrState.DataBind(); ddlBankAdrState.Items.Insert(0, new ListItem("Select a State", "Select a State")); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AddBankDetails.ascx:BindDropDowns()"); object[] objects = new object[4]; objects[0] = path; objects[1] = dtAccountType; objects[2] = dtModeofOperation; objects[3] = dtStates; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
protected void gvGovtSaving_ItemDataBound(object sender, GridItemEventArgs e) { int AccountId; string strModeOfHoldingCode; string strDebtIssuerCode; string strInterestBasisCode; string strCompoundInterestFrequencyCode; string strAssetInstrumentCategoryCode; string strInterestPayableFrequencyCode; if ((e.Item is GridEditFormItem) && e.Item.IsInEditMode) { GridEditFormItem editedItem = (GridEditFormItem)e.Item; HtmlGenericControl divAccout = (HtmlGenericControl)editedItem.FindControl("divAccout"); HtmlGenericControl divGovtSavings = (HtmlGenericControl)editedItem.FindControl("divGovtSavings"); ImageButton btnImgGovtSaving = (ImageButton)editedItem.FindControl("btnImgGovtSaving"); ImageButton btnImgAddAccount = (ImageButton)editedItem.FindControl("btnImgAddAccount"); if (e.Item.RowIndex == -1) { if (hdnCondition.Value != "1") { divGovtSavings.Visible = false; } } else { divAccout.Visible = false; } } if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted) { GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item; GridEditFormItem gefi = (GridEditFormItem)e.Item; DropDownList ddlModeOfHolding = (DropDownList)gefi.FindControl("ddlModeOfHolding"); dtModeOfHolding = XMLBo.GetModeOfHolding(path); ddlModeOfHolding.DataSource = dtModeOfHolding; ddlModeOfHolding.DataTextField = "ModeOfHolding"; ddlModeOfHolding.DataValueField = "ModeOfHoldingCode"; ddlModeOfHolding.DataBind(); ddlModeOfHolding.Items.Insert(0, new ListItem("Select", "Select")); DropDownList ddlCategory = (DropDownList)gefi.FindControl("ddlCategory"); group = "GS"; DataSet ds = assetBo.GetAssetInstrumentCategory(group); ddlCategory.DataSource = ds.Tables[0]; ddlCategory.DataTextField = "PAIC_AssetInstrumentCategoryName"; ddlCategory.DataValueField = "PAIC_AssetInstrumentCategoryCode"; ddlCategory.DataBind(); ddlCategory.Items.Insert(0, new ListItem("Select", "Select")); DropDownList ddlgovtModeofHoldings = (DropDownList)gefi.FindControl("ddlgovtModeofHoldings"); ddlgovtModeofHoldings.DataSource = dtModeOfHolding; ddlgovtModeofHoldings.DataTextField = "ModeOfHolding"; ddlgovtModeofHoldings.DataValueField = "ModeOfHoldingCode"; ddlgovtModeofHoldings.DataBind(); ddlgovtModeofHoldings.Items.Insert(0, new ListItem("Select a Mode of Holding", "0")); DropDownList ddlDebtIssuerCode = (DropDownList)gefi.FindControl("ddlDebtIssuerCode"); DataTable dtDebtIssuerCode = XMLBo.GetDebtIssuer(path); ddlDebtIssuerCode.DataSource = dtDebtIssuerCode; ddlDebtIssuerCode.DataTextField = dtDebtIssuerCode.Columns["DebtIssuerName"].ToString(); ddlDebtIssuerCode.DataValueField = dtDebtIssuerCode.Columns["DebtIssuerCode"].ToString(); ddlDebtIssuerCode.DataBind(); ddlDebtIssuerCode.Items.Insert(0, new ListItem("Select an Asset Issuer", "0")); DropDownList ddlInterestBasis = (DropDownList)gefi.FindControl("ddlInterestBasis"); DataTable dtInterestBasis = XMLBo.GetInterestBasis(path); ddlInterestBasis.DataSource = dtInterestBasis; ddlInterestBasis.DataTextField = dtInterestBasis.Columns["InterestBasisType"].ToString(); ddlInterestBasis.DataValueField = dtInterestBasis.Columns["InterestBasisCode"].ToString(); ddlInterestBasis.DataBind(); ddlInterestBasis.Items.Insert(0, new ListItem("Select an Interest Basis", "0")); ddlInterestBasis.SelectedIndex = 0; DropDownList ddlSimpleInterestFC = (DropDownList)gefi.FindControl("ddlSimpleInterestFC"); DataTable dtSimpleInterestFC = XMLBo.GetFrequency(path); ddlSimpleInterestFC.DataSource = dtSimpleInterestFC; ddlSimpleInterestFC.DataTextField = dtSimpleInterestFC.Columns["Frequency"].ToString(); ddlSimpleInterestFC.DataValueField = dtSimpleInterestFC.Columns["FrequencyCode"].ToString(); ddlSimpleInterestFC.DataBind(); ddlSimpleInterestFC.Items.Insert(0, new ListItem("Select a Frequency", "NA")); DropDownList ddlCompoundInterestFC = (DropDownList)gefi.FindControl("ddlCompoundInterestFC"); DataTable dtCompoundInterestFC = XMLBo.GetFrequency(path); ddlCompoundInterestFC.DataSource = dtCompoundInterestFC; ddlCompoundInterestFC.DataTextField = dtCompoundInterestFC.Columns["Frequency"].ToString(); ddlCompoundInterestFC.DataValueField = dtCompoundInterestFC.Columns["FrequencyCode"].ToString(); ddlCompoundInterestFC.DataBind(); ddlCompoundInterestFC.Items.Insert(0, new ListItem("Select a Frequency", "0")); RadGrid gvNominees = (RadGrid)gefi.FindControl("gvNominees"); #region loadnominnes DataTable dtCustomerAssociates = new DataTable(); DataTable dtNewCustomerAssociate = new DataTable(); DataRow drCustomerAssociates; dsCustomerAssociates = customerAccountBo.GetCustomerAssociatedRel(customerVo.CustomerId); dtCustomerAssociates = dsCustomerAssociates.Tables[0]; dtNewCustomerAssociate.Columns.Add("MemberCustomerId"); dtNewCustomerAssociate.Columns.Add("AssociationId"); dtNewCustomerAssociate.Columns.Add("Name"); dtNewCustomerAssociate.Columns.Add("Relationship"); foreach (DataRow dr in dtCustomerAssociates.Rows) { drCustomerAssociates = dtNewCustomerAssociate.NewRow(); drCustomerAssociates[0] = dr["C_AssociateCustomerId"].ToString(); drCustomerAssociates[1] = dr["CA_AssociationId"].ToString(); drCustomerAssociates[2] = dr["C_FirstName"].ToString() + " " + dr["C_LastName"].ToString(); drCustomerAssociates[3] = dr["XR_Relationship"].ToString(); dtNewCustomerAssociate.Rows.Add(drCustomerAssociates); } if (dtNewCustomerAssociate.Rows.Count > 0) { gvNominees.DataSource = dtNewCustomerAssociate; gvNominees.DataBind(); gvNominees.Visible = true; } else { } #endregion } if (e.Item is GridDataItem) { GridDataItem dataItem = e.Item as GridDataItem; } string strRelationshipCode = string.Empty; if (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.ItemIndex != -1) { GridEditFormItem gefi = (GridEditFormItem)e.Item; RadGrid gvNominees = (RadGrid)gefi.FindControl("gvNominees"); GovtSavingNPId = int.Parse(gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["CGSNP_GovtSavingNPId"].ToString()); AccountId = int.Parse(gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["CGSA_AccountId"].ToString()); strModeOfHoldingCode = gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["XMOH_ModeOfHoldingCode"].ToString(); strDebtIssuerCode = gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["XDI_DebtIssuerCode"].ToString(); strInterestBasisCode = gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["XIB_InterestBasisCode"].ToString(); strCompoundInterestFrequencyCode = gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["XF_CompoundInterestFrequencyCode"].ToString(); strAssetInstrumentCategoryCode = gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["PAIC_AssetInstrumentCategoryCode"].ToString(); strInterestPayableFrequencyCode = gvGovtSaving.MasterTableView.DataKeyValues[e.Item.ItemIndex]["XF_InterestPayableFrequencyCode"].ToString(); DropDownList ddlModeOfHolding = (DropDownList)gefi.FindControl("ddlModeOfHolding"); dtModeOfHolding = XMLBo.GetModeOfHolding(path); ddlModeOfHolding.DataSource = dtModeOfHolding; ddlModeOfHolding.DataTextField = "ModeOfHolding"; ddlModeOfHolding.DataValueField = "ModeOfHoldingCode"; ddlModeOfHolding.DataBind(); ddlModeOfHolding.SelectedValue = strModeOfHoldingCode; DropDownList ddlCategory = (DropDownList)gefi.FindControl("ddlCategory"); group = "GS"; DataSet ds = assetBo.GetAssetInstrumentCategory(group); ddlCategory.DataSource = ds.Tables[0]; ddlCategory.DataTextField = "PAIC_AssetInstrumentCategoryName"; ddlCategory.DataValueField = "PAIC_AssetInstrumentCategoryCode"; ddlCategory.DataBind(); ddlCategory.SelectedValue = strAssetInstrumentCategoryCode; DropDownList ddlgovtModeofHoldings = (DropDownList)gefi.FindControl("ddlgovtModeofHoldings"); ddlgovtModeofHoldings.DataSource = dtModeOfHolding; ddlgovtModeofHoldings.DataTextField = "ModeOfHolding"; ddlgovtModeofHoldings.DataValueField = "ModeOfHoldingCode"; ddlgovtModeofHoldings.DataBind(); ddlgovtModeofHoldings.SelectedValue = strModeOfHoldingCode; DropDownList ddlDebtIssuerCode = (DropDownList)gefi.FindControl("ddlDebtIssuerCode"); DataTable dtDebtIssuerCode = XMLBo.GetDebtIssuer(path); ddlDebtIssuerCode.DataSource = dtDebtIssuerCode; ddlDebtIssuerCode.DataTextField = dtDebtIssuerCode.Columns["DebtIssuerName"].ToString(); ddlDebtIssuerCode.DataValueField = dtDebtIssuerCode.Columns["DebtIssuerCode"].ToString(); ddlDebtIssuerCode.DataBind(); ddlDebtIssuerCode.SelectedValue = strDebtIssuerCode; DropDownList ddlInterestBasis = (DropDownList)gefi.FindControl("ddlInterestBasis"); DataTable dtInterestBasis = XMLBo.GetInterestBasis(path); ddlInterestBasis.DataSource = dtInterestBasis; ddlInterestBasis.DataTextField = dtInterestBasis.Columns["InterestBasisType"].ToString(); ddlInterestBasis.DataValueField = dtInterestBasis.Columns["InterestBasisCode"].ToString(); ddlInterestBasis.DataBind(); ddlInterestBasis.SelectedValue = strInterestBasisCode; DropDownList ddlSimpleInterestFC = (DropDownList)gefi.FindControl("ddlSimpleInterestFC"); DataTable dtSimpleInterestFC = XMLBo.GetFrequency(path); ddlSimpleInterestFC.DataSource = dtSimpleInterestFC; ddlSimpleInterestFC.DataTextField = dtSimpleInterestFC.Columns["Frequency"].ToString(); ddlSimpleInterestFC.DataValueField = dtSimpleInterestFC.Columns["FrequencyCode"].ToString(); ddlSimpleInterestFC.DataBind(); ddlSimpleInterestFC.SelectedValue = strInterestPayableFrequencyCode; DropDownList ddlCompoundInterestFC = (DropDownList)gefi.FindControl("ddlCompoundInterestFC"); DataTable dtCompoundInterestFC = XMLBo.GetFrequency(path); ddlCompoundInterestFC.DataSource = dtCompoundInterestFC; ddlCompoundInterestFC.DataTextField = dtCompoundInterestFC.Columns["Frequency"].ToString(); ddlCompoundInterestFC.DataValueField = dtCompoundInterestFC.Columns["FrequencyCode"].ToString(); ddlCompoundInterestFC.DataBind(); ddlCompoundInterestFC.SelectedValue = strCompoundInterestFrequencyCode; #region loadnominnes DataTable dtCustomerAssociates = new DataTable(); DataTable dtNewCustomerAssociate = new DataTable(); DataRow drCustomerAssociates; dsCustomerAssociates = customerAccountBo.GetCustomerAssociatedRel(customerVo.CustomerId); dtCustomerAssociates = dsCustomerAssociates.Tables[0]; dtNewCustomerAssociate.Columns.Add("MemberCustomerId"); dtNewCustomerAssociate.Columns.Add("AssociationId"); dtNewCustomerAssociate.Columns.Add("Name"); dtNewCustomerAssociate.Columns.Add("Relationship"); foreach (DataRow dr in dtCustomerAssociates.Rows) { drCustomerAssociates = dtNewCustomerAssociate.NewRow(); drCustomerAssociates[0] = dr["C_AssociateCustomerId"].ToString(); drCustomerAssociates[1] = dr["CA_AssociationId"].ToString(); drCustomerAssociates[2] = dr["C_FirstName"].ToString() + " " + dr["C_LastName"].ToString(); drCustomerAssociates[3] = dr["XR_Relationship"].ToString(); dtNewCustomerAssociate.Rows.Add(drCustomerAssociates); } if (dtNewCustomerAssociate.Rows.Count > 0) { gvNominees.DataSource = dtNewCustomerAssociate; gvNominees.DataBind(); gvNominees.Visible = true; } else { } #endregion } }