AdminController

目录

[1、 AdminController](#1、 AdminController)

[1.1、 NotEnrolledStudent](#1.1、 NotEnrolledStudent)

[1.2、 // Students Controller End](#1.2、 // Students Controller End)

[1.3、 CourseDetail](#1.3、 CourseDetail)

  1. AdminController

using ITM_College.Data;

using ITM_College.Models;

using Microsoft.AspNetCore.Mvc;

using Microsoft.EntityFrameworkCore;

namespace ITM_College.Controllers

{

public class AdminController : Controller

{

private readonly ITM_CollegeContext db;

public AdminController(ITM_CollegeContext db)

{

this.db = db;

}

    1. NotEnrolledStudent

public IActionResult NotEnrolledStudent(int id)

{

var student = db.Students.FirstOrDefault(s => s.StudentId == id);

return View(student);

}

public IActionResult StudentRequest()

{

var newStd = db.StudentCourseRegistrations.Include(s => s.AddmissionForNavigation)

.Include(c => c.Student).Where(col => col.Status == 1).ToList();

return View(newStd);

}

    1. // Students Controller End

// ------ Controller 3 Courses Controller ------

// i- All Students

// ii- Add Students

// iii- Update Student

// iv- Delete Student

public IActionResult Courses(string message,string error)

{

ViewBag.message = message;

ViewBag.error = error;

var course = db.Courses.Include(c => c.Faculty).Include(f => f.Faculty.FacultyDepartmentNavigation).ToList();

return View(course);

}

    1. CourseDetail

public IActionResult CourseDetail(int id)

{

var course = db.Courses.Include(c => c.Faculty)

.Include(f => f.Faculty.FacultyDepartmentNavigation)

.Include(s => s.StudentCourseRegistrations)

.FirstOrDefault(col => col.CourseId == id);

return View(course);

}

相关推荐
界面开发小八哥3 小时前
界面控件DevExpress Blazor v26.1新版亮点 - Filter Builder等功能升级
ui·界面控件·blazor·devexpress·ui开发
兰亭妙微UI设计公司5 小时前
兰亭妙微UI设计:Neemo Project 企业AI项目管理后台全案运营价值解析
人工智能·ui
枫叶丹41 天前
MCP、A2A、AG-UI:一篇讲清 Agent 协议栈
人工智能·ui·chatgpt·agent·codex
山川志~1 天前
Vue + Element UI 实战:如何实现表格时间、金额字段排序
vue.js·ui·elementui
Oll Correct2 天前
Adobe illustrator 案例六:手枪图标绘制
笔记·ui·adobe·illustrator
l1m0_2 天前
React+Tailwind+AI 实战:连锁餐饮管理后台从零到一开发复盘
前端·react.js·ui·ai·ai设计
ryanuo72 天前
Shadcn/ui × Qt 6/QML:一次从 Web UI 到桌面 UI 的组件化实践
c++·qt·ui·shadcn
盛夏绽放3 天前
Proxy与Reflect详解(二):进阶篇——手写Vue3响应式系统
ui·vue3·proxy
造火箭3 天前
Android UI自动化测试可行性评估SKILL
android·功能测试·ui
love530love3 天前
虚拟显示驱动导致 Photoshop / Camera Raw 卡死?OrayIddDriver 的锅
运维·人工智能·ui·photoshop·orayidddriver·hags 调度