private void BindRMforBranchDropdown(int branchId, int branchHeadId) { try { DataSet ds = advisorBranchBo.GetAllRMsWithOutBMRole(branchId, branchHeadId); if (ds != null) { ddlRM.DataSource = ds.Tables[0];; ddlRM.DataValueField = ds.Tables[0].Columns["RmID"].ToString(); ddlRM.DataTextField = ds.Tables[0].Columns["RMName"].ToString(); ddlRM.DataBind(); } ddlRM.Items.Insert(0, new System.Web.UI.WebControls.ListItem("All", "0")); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdviserEQMIS.ascx:BindRMforBranchDropdown()"); object[] objects = new object[4]; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }
private void BindRMListForBranch(int branchId, int branchHeadId) { DataSet ds = advisorBranchBo.GetAllRMsWithOutBMRole(branchId, branchHeadId); if (ds.Tables[0].Rows.Count > 0) { ddlAdviseRMList.DataSource = ds.Tables[0]; ddlAdviseRMList.DataValueField = ds.Tables[0].Columns["RmID"].ToString(); ddlAdviseRMList.DataTextField = ds.Tables[0].Columns["RMName"].ToString(); ddlAdviseRMList.DataBind(); ddlAdviseRMList.Items.Insert(0, new ListItem("Select", "Select")); CompareValidator2.ValueToCompare = "Select"; CompareValidator2.ErrorMessage = "Please select a RM"; } else { ddlAdviseRMList.Items.Clear(); ddlAdviseRMList.Items.Remove("Select"); ddlAdviseRMList.Items.Insert(0, new ListItem("No RM Available", "No RM Available")); CompareValidator2.ValueToCompare = "No RM Available"; CompareValidator2.ErrorMessage = "Cannot Add Customer Without a RM"; } }
private void BindRMforBranchDropdown(int branchId, int branchHeadId) { try { DataSet ds = advisorBranchBo.GetAllRMsWithOutBMRole(branchId, branchHeadId); if (ds.Tables[0].Rows.Count > 0) { ddlAdviseRMList.DataSource = ds.Tables[0]; ddlAdviseRMList.DataValueField = ds.Tables[0].Columns["RmID"].ToString(); ddlAdviseRMList.DataTextField = ds.Tables[0].Columns["RMName"].ToString(); ddlAdviseRMList.DataBind(); ddlAdviseRMList.Items.Remove("No RM Available"); ddlAdviseRMList.Items.Insert(0, new ListItem("Select", "Select")); CompareValidator2.ValueToCompare = "Select"; CompareValidator2.ErrorMessage = "Please select a RM"; } else { if (!IsPostBack) { ddlAdviseRMList.Items.Insert(0, new ListItem("Select", "Select")); CompareValidator2.ValueToCompare = "Select"; CompareValidator2.ErrorMessage = "Please select a RM"; } else { if (rbtnNonIndividual.Checked == true) { if ((IsPostBack) && (ddlAdviserBranchList.SelectedIndex == 0)) { ddlAdviseRMList.Items.Clear(); ddlAdviseRMList.Items.Insert(0, new ListItem("Select", "Select")); CompareValidator2.ValueToCompare = "Select"; CompareValidator2.ErrorMessage = "Please select a RM"; } else { ddlAdviseRMList.Items.Clear(); ddlAdviseRMList.Items.Remove("Select"); ddlAdviseRMList.Items.Insert(0, new ListItem("No RM Available", "No RM Available")); CompareValidator2.ValueToCompare = "No RM Available"; CompareValidator2.ErrorMessage = "Cannot Add Customer Without a RM"; } } else { if ((IsPostBack) && (ddlAdviserBranchList.SelectedIndex == 0)) { ddlAdviseRMList.Items.Clear(); ddlAdviseRMList.Items.Insert(0, new ListItem("Select", "Select")); CompareValidator2.ValueToCompare = "Select"; CompareValidator2.ErrorMessage = "Please select a RM"; } else { ddlAdviseRMList.Items.Clear(); ddlAdviseRMList.Items.Remove("Select"); ddlAdviseRMList.Items.Insert(0, new ListItem("No RM Available", "No RM Available")); CompareValidator2.ValueToCompare = "No RM Available"; CompareValidator2.ErrorMessage = "Cannot Add Customer Without a RM"; } } } } } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "AdviserMFMIS.ascx:BindBranchDropDown()"); object[] objects = new object[4]; FunctionInfo = exBase.AddObject(FunctionInfo, objects); exBase.AdditionalInformation = FunctionInfo; ExceptionManager.Publish(exBase); throw exBase; } }