Exemplo n.º 1
0
        /// <summary>
        /// 根据ModelID选项来设查询
        /// </summary>
        /// <returns></returns>
        private object Loades()
        {
            object      res = null;
            T_CourseDAL dal = new T_CourseDAL();

            switch (modelID)
            {
            case -1: { res = dal.ExecuteListCourseName(curIndex, dataLength); }; break;

            case 0: { res = dal.ExecuteListCourseName(curIndex, dataLength, values[0]); }; break;

            case 1:
            {
                res = dal.ExecuteT_Course(curIndex, dataLength, string.Empty, string.Empty, string.Empty);
            }; break;

            case 2: {
                res = dal.ExecuteT_Course(curIndex, dataLength, values[0], values[1], values[2]);
            }; break;

            case 3: {
                res = dal.ExecuteT_CourseFaction(curIndex, dataLength, string.Empty, string.Empty, string.Empty, string.Empty);
            }; break;

            case 4: {
                res = dal.ExecuteT_CourseFaction(curIndex, dataLength, values[0], values[1], values[2], values[3]);
            }; break;

            case 5:
            {
                res = dal.ExecuteClassStudentsCompulsoryCourseFaction(curIndex, dataLength, values[0], values[1]);
            }; break;

            default:; break;
            }
            return(res);
        }
Exemplo n.º 2
0
        //初始加载所有课程信息(此课程信息即本学校所开设的课程)
        private void LoadInitDataGridView()
        {
            T_CourseDAL         dal  = new T_CourseDAL();
            int                 temp = curIndex;
            List <T_CourseName> res  = null;

            try
            {
                curIndex = 1;
                res      = dal.ExecuteListCourseName(curIndex, dataLength);
            }
            catch
            {
                curIndex = temp;
            }
            if (res == null)
            {
                return;
            }
            dataGridView1.DataSource          = res;
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
        }