/// <summary>
        /// 查询UserProgress页面详细记录
        /// </summary>
        /// <returns></returns>
        public ActionResult UserProgress()
        {
            WX_UserProgressListModel   model  = new WX_UserProgressListModel();
            vw_UserProgressSearchModel search = new vw_UserProgressSearchModel();

            model.search             = search;
            model.search.PageSize    = 15;                                                           //每页显示15条数据
            model.search.CurrentPage = model.search.CurrentPage <= 0 ? 1 : model.search.CurrentPage; //获取当前页
            Students s = StudentData.GetStudentByAccountID(UserSessionWX.userid);                    //获取学员

            if (s != null)
            {
                search.StudentID = s.ID;                                                                       //获取学号
            }
            PagedList <vw_UserProgress> vw_UserProgress = UserProgressListData.Getvw_UserProgressList(search); //查询学员课程表

            model.UserProgressList = vw_UserProgress;
            return(View(model));
        }
Beispiel #2
0
        /// <summary>
        /// 分页获取UserProgressListData页面数据
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public static PagedList <vw_UserProgress> Getvw_UserProgressList(vw_UserProgressSearchModel search)
        {
            string table = string.Empty, fields = string.Empty, orderby = string.Empty, where = string.Empty; //定义结构

            fields  = @"  * ";                                                                                //输出字段
            table   = @" vw_UserProgress ";                                                                   //表或者视图
            orderby = "StudentID";                                                                            //排序信息
            StringBuilder sb = new StringBuilder();                                                           //构建where条件

            sb.Append(" 1=1 ");
            if (!string.IsNullOrWhiteSpace(search.StudentID))//学生ID,学号
            {
                sb.AppendFormat(" and  StudentID ='{0}' ", search.StudentID);
            }
            where = sb.ToString();
            int allcount = 0;
            var list     = CommonPage <vw_UserProgress> .GetPageList(
                out allcount, table, fields : fields, where : where.Trim(),
                orderby : orderby, pageindex : search.CurrentPage, pagesize : search.PageSize, connect : DBKeys.PRX);

            return(new PagedList <vw_UserProgress>(list, search.CurrentPage, search.PageSize, allcount));
        }