Exemple #1
0
        public async Task <IActionResult> Index()
        {
            var boVMCollection           = new List <CoursesVM>();   // 组织授权编辑的课程
            var personCourseVMCollection = new List <CoursesVM>();   // 个人创建的课程

            var userIdentity = User.Identity;

            if (!String.IsNullOrEmpty(userIdentity.Name))
            {
                // 组织授权编辑的课程
                boVMCollection = await _boVMService.GetboVMCollectionByUserAsyn(userIdentity.Name, AuthorizationTypeEnum.编辑权限);

                // 获取个人编写的课程
                personCourseVMCollection = await _boVMService.GetboVMCollectionByCreatorAsyn(userIdentity.Name);
            }

            ViewData["PersonCourseVMCollection"] = personCourseVMCollection;

            ViewData["ModuleName"]   = "课程管理";
            ViewData["FunctionName"] = "课程清单";
            return(View(boVMCollection));
        }