public void FillChapters_Topic() { obj_BAL_Student_Dashboard = new Student_DashBoard_BLogic(); obj_Student_Dashboard = new StudentDash(); obj_Student_Dashboard.BMSID = Convert.ToInt64(Session["BMSID"]); obj_Student_Dashboard.SubjectID = Convert.ToInt16(Session["SubjectID"]); obj_Student_Dashboard.StudentID = Convert.ToInt64(Session["StudentID"]); // DataSet dsSettings = new DataSet(); dsSettings = obj_BAL_Student_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings(); IsAllow_Enable_Settings(dsSettings); DataSet dsSelect = new DataSet(); dsSelect = obj_BAL_Student_Dashboard.BAL_Select_Chapters_Topics(obj_Student_Dashboard); if (dsSelect.Tables.Count == ((int)EnumFile.AssignValue.One)) { if (dsSelect.Tables[0].Rows[0]["NoRecord"].ToString().Equals("0")) { WebMsg.Show("No Chatper availbale."); DropDownList[] disddl = { ddlChapter, ddlTopic }; DisableDropDwon(disddl); } } else if (dsSelect.Tables.Count > ((int)EnumFile.AssignValue.Zero) && dsSelect.Tables[0].Rows.Count > ((int)EnumFile.AssignValue.Zero)) { ddlChapter.DataSource = dsSelect.Tables[0]; ddlChapter.DataTextField = "Chapter"; ddlChapter.DataValueField = "ChapterID"; ddlChapter.DataBind(); ddlChapter.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), new ListItem("-- Select --")); //DropDownList[] disddl = { ddlChapter, ddlTopic }; //EnableDropDwon(disddl); if (dsSelect.Tables[2].Rows.Count > ((int)EnumFile.AssignValue.Zero)) { if (dsSelect.Tables[2].Rows[0]["ChapterID"].ToString().Equals("")) { ddlChapter.SelectedIndex = ((int)EnumFile.AssignValue.Zero); } else { ddlChapter.SelectedValue = dsSelect.Tables[2].Rows[0]["ChapterID"].ToString(); } } //DropDownList[] disddl1 = { ddlTopic }; //DisableDropDwon(disddl1); ViewState["TopicTable"] = (DataTable)dsSelect.Tables[1]; ddlTopic.DataSource = dsSelect.Tables[1]; ddlTopic.DataTextField = "Topic"; ddlTopic.DataValueField = "TopicID"; ddlTopic.DataBind(); ddlTopic.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), new ListItem("-- Select --")); ddlTopic.SelectedIndex = Convert.ToInt32(EnumFile.AssignValue.Zero); if (dsSelect.Tables[3].Rows.Count > ((int)EnumFile.AssignValue.Zero)) { if (dsSelect.Tables[3].Rows[0]["TopicID"].ToString().Equals("")) { ddlTopic.SelectedIndex = ((int)EnumFile.AssignValue.Zero); } else { ViewState["TopicID"] = dsSelect.Tables[3].Rows[0]["TopicID"].ToString(); ddlTopic.SelectedValue = dsSelect.Tables[3].Rows[0]["TopicID"].ToString(); } } } else { DropDownList[] disddl = { ddlChapter, ddlTopic }; DisableDropDwon(disddl); } }