private void BindCategories() { repoBo = new RepositoryBo(); DataSet ds = new DataSet(); ds = repoBo.GetRepositoryCategory(advisorVo.advisorId); int intRepoCount = ds.Tables[0].Rows.Count; int intRoleCount = ds.Tables[1].Rows.Count; ViewState["intRepoDSCount"] = intRepoCount; if (intRepoCount > 0) { for (int i = 0; i < intRepoCount; i++) { Label lbl = (Label)this.FindControl("lblCategory" + (i + 1).ToString()); HiddenField hdn = (HiddenField)this.FindControl("hdnCat" + (i + 1).ToString()); TextBox txt = (TextBox)this.FindControl("txtCategory" + (i + 1).ToString()); CheckBoxList chkbxlst = (CheckBoxList)this.FindControl("CheckBoxList" + (i + 1).ToString()); lbl.Text = ds.Tables[0].Rows[i]["ARC_RepositoryCategory"].ToString(); hdn.Value = ds.Tables[0].Rows[i]["ARC_AdviserRepositoryCategoryId"].ToString(); txt.Text = ds.Tables[0].Rows[i]["ARC_RepositoryCategory"].ToString(); // Filter 2nd Dataset based on hdn.Value foreach (DataRow dr in ds.Tables[1].Select("ARC_AdviserRepositoryCategoryId = '" + hdn.Value + "'")) { if (dr["UR_RoleId"].ToString() == strAdviserAdminRoleId) { SelectCheckboxListItem(chkbxlst, strAdviserAdminRoleId); } else if (dr["UR_RoleId"].ToString() == strRMRoleId) { SelectCheckboxListItem(chkbxlst, strRMRoleId); } else if (dr["UR_RoleId"].ToString() == strBMRoleId) { SelectCheckboxListItem(chkbxlst, strBMRoleId); } else if (dr["UR_RoleId"].ToString() == strCustomerRoleId) { SelectCheckboxListItem(chkbxlst, strCustomerRoleId); } else if (dr["UR_RoleId"].ToString() == strOpsRoleId) { SelectCheckboxListItem(chkbxlst, strOpsRoleId); } else if (dr["UR_RoleId"].ToString() == strResearchRoleId) { SelectCheckboxListItem(chkbxlst, strResearchRoleId); } } } } }
private void BindCategory() { repoBo = new RepositoryBo(); ds = new DataSet(); int CatId = 0; CatId = creatingProspectus(); ds = repoBo.GetRepositoryCategory(advisorVo.advisorId); if (ds.Tables[0].Rows.Count > 0) { // Bind Category DDL for Manage Tab ddlRCategory.DataSource = ds.Tables[0]; ddlRCategory.DataTextField = strRepositoryCategoryTextField; ddlRCategory.DataValueField = strRepositoryCategoryValueField; ddlRCategory.DataBind(); ddlRCategory.Items.Insert(0, new ListItem("Select", "Select")); } if (CatId > 0) { ddlRCategory.SelectedValue = "PR"; ddlRCategory.Enabled = false; } }