Exemplo n.º 1
0
        public async Task <ActionResult> GetPageListJson(StudentInfoListParam param, Pagination pagination)
        {
            OperatorInfo operatorInfo = await Operator.Instance.Current();

            if (!operatorInfo.RoleIds.Contains(GlobalContext.SystemConfig.RoleId))//不是超级管理员
            {
                param.SysDepartmentId = operatorInfo.DepartmentId;
            }
            TData <List <StudentInfoEntity> > obj = await studentInfoBLL.GetPageList(param, pagination);

            return(Json(obj));
        }
Exemplo n.º 2
0
        public ActionResult LoadPageList(int pageSize, int pageIndex)
        {
            int elems     = sbll.GetAll().Count();
            int pageCount = Convert.ToInt32(Math.Ceiling(elems * 1.0 / pageSize));

            pageIndex = pageIndex < 1 ? 1 : pageIndex;
            pageIndex = pageIndex > pageCount ? pageCount : pageIndex;
            var list = sbll.GetPageList(pageSize, pageIndex)
                       .Select(x => new
            {
                Id     = x.sId,
                Name   = x.sName,
                Gender = x.sGender,
                DOB    = x.sBirthday,
                Phone  = x.sPhone,
                Email  = x.sEMail,
                Class  = x.ClassInfo.cTitle
            })
                       .ToList();
            string pgbar = PageBar.GetPageBar(pageIndex, pageCount);

            return(Json(new { myList = list, myPageBar = pgbar }, JsonRequestBehavior.AllowGet));
        }