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);

}

相关推荐
MediaTea11 小时前
七次课掌握 Photoshop:选区与抠图
ui·photoshop
不秃头的UI设计师15 小时前
UI界面设计入门:打造卓越用户体验
ui·ux·ui设计
未来的嗒嘀嗒16 小时前
Axure是什么软件?全方位解读助力设计入门
ui·photoshop
wrx繁星点点17 小时前
状态模式(State Pattern)详解
java·开发语言·ui·设计模式·状态模式
SoraLuna1 天前
「Mac畅玩鸿蒙与硬件28」UI互动应用篇5 - 滑动选择器实现
macos·ui·harmonyos
martian6652 天前
QT开发:掌握现代UI动画技术:深入解析QML和Qt Quick中的动画效果
开发语言·c++·qt·ui
初九之潜龙勿用2 天前
C#结合JS解决Word添加无效位图导致进程停滞的问题
javascript·ui·c#·word·asp.net
AI原吾2 天前
`psdparse`:解锁Photoshop PSD文件的Python密钥
python·ui·ai·photoshop·psdparse
赵锦川2 天前
nuiapp vue3 uni-ui uni.uploadFile 图片上传
javascript·vue.js·ui
dangoxiba2 天前
[Unity Demo]从零开始制作空洞骑士Hollow Knight第十八集:制作UI系统的主菜单界面和选择存档界面
ui