public async Task <ActionResult> GetPageListJson(DetailsListParam param, Pagination pagination)
        {
            OperatorInfo operatorInfo = await Operator.Instance.Current();

            if (!operatorInfo.RoleIds.Contains(GlobalContext.SystemConfig.RoleId))//不是超级管理员
            {
                param.SysDepartmentId = operatorInfo.DepartmentId;
            }

            StudentInfoListParam stuaram = new StudentInfoListParam();

            param.SysDepartmentId = operatorInfo.DepartmentId;
            TData <List <StudentInfoEntity> > stuobj = await studentInfoBLL.GetList(stuaram);

            TData <List <DetailsEntity> > obj = await detailsBLL.GetPageList(param, pagination);

            TData <List <DetailsInfo> > infos = new TData <List <DetailsInfo> >();

            if (stuobj.Tag == 1 && stuobj.Result.Any() && obj.Tag == 1 && obj.Result.Any())
            {
                infos.Result     = obj.Result.MapToMany <DetailsEntity, DetailsInfo>();
                infos.Tag        = 1;
                infos.TotalCount = obj.TotalCount;
                foreach (var model in infos.Result)
                {
                    model.StudentName = stuobj.Result.Where(x => x.Code == model.StudentCode).FirstOrDefault().Name;
                }
                return(Json(infos));
            }
            return(Json(obj));
        }
Esempio n. 2
0
        public async Task <ActionResult> GetListJson(StudentInfoListParam param)
        {
            OperatorInfo operatorInfo = await Operator.Instance.Current();

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

            return(Json(obj));
        }