protected void ddlAddLoanType_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddlAddLoanPartner; DropDownList ddlAddLoanType; DropDownList ddlSchemeName; ddlAddLoanPartner = gvLnCommsnStrucLnPtr.FooterRow.FindControl("ddlAddLoanPartner") as DropDownList; ddlAddLoanType = gvLnCommsnStrucLnPtr.FooterRow.FindControl("ddlAddLoanType") as DropDownList; int Loantype = 0; int LoanPartner = 0; if (ddlAddLoanType.SelectedItem.Value.ToString() != "Select Loan Type") { Loantype = Convert.ToInt32(ddlAddLoanType.SelectedItem.Value.ToString()); } if (ddlAddLoanPartner.SelectedItem.Value.ToString() != "Select Loan Partner") { LoanPartner = Convert.ToInt32(ddlAddLoanPartner.SelectedItem.Value.ToString()); } AdviserLoanCommsnStrucWithLoanPartnerBo AdviserLoanCommsnStrucWithLoanPartner = new AdviserLoanCommsnStrucWithLoanPartnerBo(); DataSet ds = AdviserLoanCommsnStrucWithLoanPartner.GetAdviserLoanSchemeNameForLnPtnrLnType(Loantype, LoanPartner, adviserVo.advisorId); ddlSchemeName = gvLnCommsnStrucLnPtr.FooterRow.FindControl("ddlAddSchemeName") as DropDownList; ddlSchemeName.DataSource = ds; ddlSchemeName.DataTextField = "LoanSchemeName"; ddlSchemeName.DataValueField = "LoanSchemeId"; ddlSchemeName.DataBind(); ddlSchemeName.Items.Insert(0, "Select Scheme"); }
protected void ddlLoanType_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl = (DropDownList)sender; GridViewRow gvr = (GridViewRow)ddl.Parent.Parent; DropDownList ddlLoanPartner; DropDownList ddlLoanType; DropDownList ddlSchemeName; ddlLoanPartner = gvr.FindControl("ddlLoanPartner") as DropDownList; ddlLoanType = gvr.FindControl("ddlLoanType") as DropDownList; int Loantype = Convert.ToInt32(ddlLoanType.SelectedItem.Value.ToString()); int LoanPartner = Convert.ToInt32(ddlLoanPartner.SelectedItem.Value.ToString()); AdviserLoanCommsnStrucWithLoanPartnerBo AdviserLoanCommsnStrucWithLoanPartner = new AdviserLoanCommsnStrucWithLoanPartnerBo(); DataSet ds = AdviserLoanCommsnStrucWithLoanPartner.GetAdviserLoanSchemeNameForLnPtnrLnType(Loantype, LoanPartner, adviserVo.advisorId); ddlSchemeName = gvr.FindControl("ddlSchemeName") as DropDownList; ddlSchemeName.DataSource = ds; ddlSchemeName.DataBind(); ddlSchemeName.Items.Insert(0, "Select Scheme"); }
protected void gvLnCommsnStrucLnPtr_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { DropDownList ddlAddLoanPartner; DropDownList ddlAddLoanType; DropDownList ddlSchemeName; ddlAddLoanPartner = e.Row.FindControl("ddlAddLoanPartner") as DropDownList; if (ddlAddLoanPartner != null) { ddlAddLoanPartner.DataSource = XMLBo.GetLoanPartner(path); ddlAddLoanPartner.DataTextField = "XLP_LoanPartner"; ddlAddLoanPartner.DataValueField = "XLP_LoanPartnerCode"; ddlAddLoanPartner.DataBind(); ddlAddLoanPartner.Items.Insert(0, "Select Loan Partner"); } ddlAddLoanType = e.Row.FindControl("ddlAddLoanType") as DropDownList; if (ddlAddLoanType != null) { ddlAddLoanType.DataSource = XMLBo.GetLoanType(path); ddlAddLoanType.DataTextField = "XLT_LoanType"; ddlAddLoanType.DataValueField = "XLT_LoanTypeCode"; ddlAddLoanType.DataBind(); ddlAddLoanType.Items.Insert(0, "Select Loan Type"); } ddlSchemeName = e.Row.FindControl("ddlAddSchemeName") as DropDownList; ddlSchemeName.Items.Insert(0, "Select Scheme"); } if (e.Row.RowType == DataControlRowType.DataRow) { if (dsCount != 0) { DropDownList ddlLoanPartner; DropDownList ddlLoanType; DropDownList ddlSchemeName; AdviserLoanCommsnStrucWithLoanPartnerVo adviserLoanCommsnStrucWithLoanPartnervo = new AdviserLoanCommsnStrucWithLoanPartnerVo(); adviserLoanCommsnStrucWithLoanPartnervo = AdviserLoanCommsnStrucWithLoanPartnerVoList[gvLnCommsnStrucLnPtr.Rows.Count]; ddlLoanPartner = e.Row.FindControl("ddlLoanPartner") as DropDownList; if (ddlLoanPartner != null) { ddlLoanPartner.DataSource = XMLBo.GetLoanPartner(path); ddlLoanPartner.DataTextField = "XLP_LoanPartner"; ddlLoanPartner.DataValueField = "XLP_LoanPartnerCode"; ddlLoanPartner.DataBind(); ddlLoanPartner.SelectedValue = adviserLoanCommsnStrucWithLoanPartnervo.LoanPartnerCode.ToString(); } ddlLoanType = e.Row.FindControl("ddlLoanType") as DropDownList; if (ddlLoanType != null) { ddlLoanType.DataSource = XMLBo.GetLoanType(path); ddlLoanType.DataTextField = "XLT_LoanType"; ddlLoanType.DataValueField = "XLT_LoanTypeCode"; ddlLoanType.DataBind(); ddlLoanType.SelectedValue = adviserLoanCommsnStrucWithLoanPartnervo.LoanTypeCode.ToString(); } AdviserLoanCommsnStrucWithLoanPartnerBo AdviserLoanCommsnStrucWithLoanPartner = new AdviserLoanCommsnStrucWithLoanPartnerBo(); DataSet ds1 = AdviserLoanCommsnStrucWithLoanPartner.GetAdviserLoanSchemeNameForLnPtnrLnType(int.Parse(ddlLoanType.SelectedValue), int.Parse(ddlLoanPartner.SelectedValue), adviserVo.advisorId); ddlSchemeName = e.Row.FindControl("ddlSchemeName") as DropDownList; if (ddlSchemeName != null) { ddlSchemeName.DataSource = ds1; ddlSchemeName.DataTextField = "LoanSchemeName"; ddlSchemeName.DataValueField = "LoanSchemeId"; ddlSchemeName.DataBind(); ddlSchemeName.SelectedValue = adviserLoanCommsnStrucWithLoanPartnervo.LoanSchemeId.ToString(); } } } }