Exemple #1
0
        //course dropdow call by ajax
        public List <SelectListItem> GetAllCourseByStudentId(int studentId)
        {
            List <SelectListItem> selectListItems = new List <SelectListItem>();

            selectListItems.Add(new SelectListItem()
            {
                Text = "--Select--", Value = ""
            });

            List <Course> getAllCourseList = AStudentResultGateway.GetAllCourseByStudentId(studentId);


            foreach (Course aCourse in getAllCourseList)
            {
                SelectListItem selectList = new SelectListItem();
                selectList.Text  = aCourse.CourseCode;
                selectList.Value = aCourse.CourseId.ToString();
                selectListItems.Add(selectList);
            }
            return(selectListItems);
        }