protected override async Task OnInitializedAsync() { _category = await manageCategories.GetForumCategoryAsync(id); head.Title = "Forum Category | Administration"; await LoadTopicsAsync(); blazorModal.OnConfirmDeleteForumCategory += CategoryDeleteConfirmed; blazorModal.OnConfirmDeleteForumTopicItem += TopicDeleteConfirmed; }
private async Task UpdateCategory() { var editedCategory = new Models.ForumCategory() { Title = category.Title, Description = category.Description, ForumCategoryId = id, ForumId = forumId, Rank = category.Rank }; var updated = await manageCategories.UpdateCategoryAsync(editedCategory); btnVisibility = "d-inline-block"; submitVisibility = "d-none"; navManager.NavigateTo(String.Format("/admin/manage/forums/{0}/categories/{1}", forumId, id)); }
protected override async Task OnInitializedAsync() { _category = await manageForumCategories.GetForumCategoryAsync(id); head.Title = _category.Title; head.Description = _category.Description; _topics = await manageForumTopics.GetApprovedForumTopicsAsync(id); if (_maxCount >= _topics.Count) { _loadMoreVisibility = "d-none"; } _topics = _topics.OrderByDescending(p => p.PostedDate).Take(_maxCount).ToList(); CurrentUserId = await new Domain.Utilities.Membership.UserInfo(userManager, authStateProvider).GetUserId(); await AddUserToTopicAsync(); await SetTopicsCount(); }
private async Task CreateCategory() { var newCategory = new Models.ForumCategory() { Title = category.Title, ForumCategoryUrl = category.ForumCategoryUrl, Description = category.Description, ForumId = ForumId }; var added = await manageCategories.CreateCategoryAsync(newCategory); btnVisibility = "d-inline-block"; submitVisibility = "d-none"; category.Title = string.Empty; category.Description = string.Empty; titleClass = "form-control clear-validation"; urlClass = "form-url-control clear-validation"; textAreaClass = "mt-2 form-control clear-validation"; StateHasChanged(); OnCategoryCreated?.Invoke(); }
private async Task CreateForum_cc98() { //============================================================================== //============================================================================== var forum1 = new Models.Forum() { Title = "学习", EnableUpDownVotes = true, Description = "关于学习的模块" }; await manageForums.CreateForumAsync(forum1); var category1_1 = new Models.ForumCategory() { Title = "学习天地 ^_^", Description = "交流经验,答疑解惑,相互促进,共同进步", ForumId = forum1.ForumId }; await manageCategories.CreateCategoryAsync(category1_1); var category1_2 = new Models.ForumCategory() { Title = "外语学习 ^_^", Description = "让不同的语言,不同的文化在这里碰撞,擦出美丽的思想的火花~~", ForumId = forum1.ForumId }; await manageCategories.CreateCategoryAsync(category1_2); var category1_3 = new Models.ForumCategory() { Title = "留学交流 ^_^", Description = "留洋人聚集的广场,G、T经验交流的场所", ForumId = forum1.ForumId }; await manageCategories.CreateCategoryAsync(category1_3); var category1_4 = new Models.ForumCategory() { Title = "考研一族 ^_^", Description = "艰难困苦,玉汝于成;考研路上,你我同行", ForumId = forum1.ForumId }; await manageCategories.CreateCategoryAsync(category1_4); var category1_5 = new Models.ForumCategory() { Title = "编程技术 ^_^", Description = "C/C++, Pascal, Basic, Lisp, Perl/Python/Ruby...Anything you want", ForumId = forum1.ForumId }; await manageCategories.CreateCategoryAsync(category1_5); var category1_6 = new Models.ForumCategory() { Title = "编程答疑 ^_^", Description = "编程基础问题解答,ACM-ICPC、算法问题讨论", ForumId = forum1.ForumId }; await manageCategories.CreateCategoryAsync(category1_6); var category1_7 = new Models.ForumCategory() { Title = "社科学术 ^_^", Description = "历史、哲学、军事、艺术、科技、经济、政法,可讨论相关话题", ForumId = forum1.ForumId }; await manageCategories.CreateCategoryAsync(category1_7); //============================================================================== //============================================================================== //============================================================================== var forum2 = new Models.Forum() { Title = "信息", EnableUpDownVotes = true, Description = "test cc98 02" }; await manageForums.CreateForumAsync(forum2); var category2_1 = new Models.ForumCategory() { Title = "校园信息 ^_^", Description = "知人所道,道己所知", ForumId = forum2.ForumId }; await manageCategories.CreateCategoryAsync(category2_1); var category2_2 = new Models.ForumCategory() { Title = "研究生 ^_^", Description = "选课题?月钱?毕业论文?这里是研究生学习、生活、工作的交流平台", ForumId = forum2.ForumId }; await manageCategories.CreateCategoryAsync(category2_2); var category2_3 = new Models.ForumCategory() { Title = "新生宝典 ^_^", Description = "构建新老生交流平台,以有限的空间满足无限的需要", ForumId = forum2.ForumId }; await manageCategories.CreateCategoryAsync(category2_3); //============================================================================== //============================================================================== var forum3 = new Models.Forum() { Title = "兴趣", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum3); var category3_1 = new Models.ForumCategory() { Title = "数码世界 ^_^", Description = "digi……", ForumId = forum3.ForumId }; await manageCategories.CreateCategoryAsync(category3_1); var category3_2 = new Models.ForumCategory() { Title = "电脑医院 ^_^", Description = "有电脑应用或者网络的问题?砸过来讨论吧~这里是你技术进阶的乐园^_^", ForumId = forum3.ForumId }; await manageCategories.CreateCategoryAsync(category3_2); var category3_3 = new Models.ForumCategory() { Title = "动漫讨论 ^_^", Description = "动风抚心,漫影舞情;动漫天地,美好永远", ForumId = forum3.ForumId }; await manageCategories.CreateCategoryAsync(category3_3); //============================================================================== //============================================================================== var forum4 = new Models.Forum() { Title = "交易", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum4); var category4_1 = new Models.ForumCategory() { Title = "生活点滴 ^_^", Description = "点滴生活,你我共享", ForumId = forum4.ForumId }; await manageCategories.CreateCategoryAsync(category4_1); var category4_2 = new Models.ForumCategory() { Title = "数码交易 ^_^", Description = "电脑周边,数码产品", ForumId = forum4.ForumId }; await manageCategories.CreateCategoryAsync(category4_2); var category4_3 = new Models.ForumCategory() { Title = "服饰美肤 ^_^", Description = "衣裤鞋包,护肤化妆", ForumId = forum4.ForumId }; //============================================================================== var forum5 = new Models.Forum() { Title = "情感", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum5); var forum6 = new Models.Forum() { Title = "生活", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum6); var forum7 = new Models.Forum() { Title = "教师答疑", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum7); var forum8 = new Models.Forum() { Title = "院系交流", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum8); var forum9 = new Models.Forum() { Title = "社团风采", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum9); var forum10 = new Models.Forum() { Title = "天下一家", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum10); var forum11 = new Models.Forum() { Title = "cc98协会", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum11); var forum12 = new Models.Forum() { Title = "论坛管理", EnableUpDownVotes = true, Description = "test cc98 03" }; await manageForums.CreateForumAsync(forum12); btnVisibility = "d-inline-block"; submitVisibility = "d-none"; OnForumCreated?.Invoke(); }
private async Task CreateForum_Course() { //============================================================================== var forum0 = new Models.Forum() { Title = "选课交流", EnableUpDownVotes = true, Description = "关于选课的模块" }; await manageForums.CreateForumAsync(forum0); var category0_1 = new Models.ForumCategory() { Title = "选课交流", Description = "交流经验,相互促进,共同进步", ForumId = forum0.ForumId, ForumCategoryUrl = "Elective" }; await manageCategories.CreateCategoryAsync(category0_1); //============================================================================== var forum1 = new Models.Forum() { Title = "软件工程", EnableUpDownVotes = true, Description = "关于软件工程课程的模块" }; await manageForums.CreateForumAsync(forum1); await addSubmoduleOfCourse(forum1.ForumId); var forum2 = new Models.Forum() { Title = "B/S体系软件设计", EnableUpDownVotes = true, Description = "关于B/S体系软件设计课程的模块" }; await manageForums.CreateForumAsync(forum2); await addSubmoduleOfCourse(forum2.ForumId); var forum3 = new Models.Forum() { Title = "编译原理", EnableUpDownVotes = true, Description = "关于编译原理课程的模块" }; await manageForums.CreateForumAsync(forum3); await addSubmoduleOfCourse(forum3.ForumId); var forum4 = new Models.Forum() { Title = "操作系统", EnableUpDownVotes = true, Description = "关于操作系统课程的模块" }; await manageForums.CreateForumAsync(forum4); await addSubmoduleOfCourse(forum4.ForumId); var forum5 = new Models.Forum() { Title = "计算机网络", EnableUpDownVotes = true, Description = "关于计算机网络课程的模块" }; await manageForums.CreateForumAsync(forum5); await addSubmoduleOfCourse(forum5.ForumId); //============================================================================== btnVisibility = "d-inline-block"; submitVisibility = "d-none"; OnForumCreated?.Invoke(); }
protected override async Task OnInitializedAsync() { head.Title = "Edit Forum Category | Administration"; category = await manageCategories.GetForumCategoryAsync(id); }