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

}

相关推荐
xiaoxue..1 天前
TailwindCSS:从“样式民工”到“UI乐高大师”的逆袭
前端·css·ui
没有bug.的程序员2 天前
自动化测试之魂:Selenium 与 TestNG 深度集成内核、Page Object 模型实战与 Web UI 交付质量指南
前端·自动化测试·selenium·ui·testng·page·object
赵鑫亿2 天前
ClawPanel v4.4.0 发布:AI 智能助手 + 模型兼容性修复 + UI 优化
人工智能·ui·docker·容器·qq·openclaw
我命由我123452 天前
Photoshop - Photoshop 工具栏(69)前景色和背景色
学习·ui·职场和发展·求职招聘·职场发展·学习方法·photoshop
我命由我123452 天前
Photoshop - Photoshop 工具栏(70)以快速蒙版/标准模式编辑
学习·ui·职场和发展·求职招聘·职场发展·学习方法·photoshop
少云清2 天前
【UI自动化测试】1_PO模式 _面向过程编码
ui·po模式
少云清2 天前
【UI自动化测试】2_PO模式 _单元测试框架(重点)
ui·单元测试·po模式
我是苏苏2 天前
Web开发:使用Ocelot+Nacos+WebApi作简单网关鉴权
前端·javascript·ui
我命由我123452 天前
Photoshop - Photoshop 工具栏(67)修补工具
学习·ui·职场和发展·求职招聘·职场发展·学习方法·photoshop
AaronZZH2 天前
AG-UI:连接 AI 智能体与用户应用的开放协议
人工智能·ui