コード例 #1
0
        protected void uiDropDownListClasses_SelectedIndexChanged(object sender, EventArgs e)
        {
            DBLayer db = new DBLayer();
            uiDropDownListClassRooms.DataSource = db.GetAllClassRoomsByClassID(Convert.ToInt32(uiDropDownListClasses.SelectedValue));
            uiDropDownListClassRooms.DataTextField = "ArName";
            uiDropDownListClassRooms.DataValueField = "ClassRoomID";
            uiDropDownListClassRooms.DataBind();

            uiDropDownListCourses.DataSource = db.GetAllCoursesByClass(Convert.ToInt32(uiDropDownListClasses.SelectedValue));
            uiDropDownListCourses.DataTextField = "ArName";
            uiDropDownListCourses.DataValueField = "CourseID";
            uiDropDownListCourses.DataBind();
        }
コード例 #2
0
        private void LoadDDLs()
        {
            DBLayer db = new DBLayer();
            uiDropDownListClasses.DataSource = db.GetAllClass();
            uiDropDownListClasses.DataTextField = "ArName";
            uiDropDownListClasses.DataValueField = "ClassID";
            uiDropDownListClasses.DataBind();
            uiDropDownListClasses.SelectedIndex = 0;

            uiDropDownListClassRooms.DataSource = db.GetAllClassRoomsByClassID(Convert.ToInt32(uiDropDownListClasses.SelectedValue));
            uiDropDownListClassRooms.DataTextField = "ArName";
            uiDropDownListClassRooms.DataValueField = "ClassRoomID";
            uiDropDownListClassRooms.DataBind();
            uiDropDownListClassRooms.SelectedIndex = 0;

            uiDropDownListCourses.DataSource = db.GetAllCoursesByClass(Convert.ToInt32(uiDropDownListClasses.SelectedValue));
            uiDropDownListCourses.DataTextField = "ArName";
            uiDropDownListCourses.DataValueField = "CourseID";
            uiDropDownListCourses.DataBind();

            uiDropDownListSchoolYear.DataSource = db.GetAllSchoolYear();
            uiDropDownListSchoolYear.DataTextField = "ArName";
            uiDropDownListSchoolYear.DataValueField = "SchoolYearID";
            uiDropDownListSchoolYear.DataBind();
            uiDropDownListSchoolYear.SelectedIndex = 0;
        }
コード例 #3
0
 private void BindData()
 {
     DBLayer db = new DBLayer();
     DataSet ds = new DataSet();
     ds = db.GetAllCoursesByClass(Convert.ToInt32(uiDropDownListClasses.SelectedValue));
     uiGridViewCourses.DataSource = ds;
     uiGridViewCourses.DataBind();
 }