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

}

相关推荐
struggle20259 小时前
helm-dashboard为Helm设计的缺失用户界面 - 可视化您的发布,它提供了一种基于UI的方式来查看已安装的Helm图表
开发语言·ui·计算机视觉·编辑器·知识图谱
黑金IT1 天前
Python3 + Qt5:实现AJAX异步更新UI
qt·ui·ajax
喵叔哟1 天前
5. 【Vue实战--孢子记账--Web 版开发】-- 主页UI
前端·vue.js·ui
山海青风2 天前
Axure入门教程 -- 第五章:原型优化与调试
ui·交互·axure
浅陌sss3 天前
Unity 粒子特效在UI中使用裁剪效果
ui·unity·游戏引擎
机器视觉小小测试员4 天前
工业相机常用词语解释
运维·ui·自动化·工业相机
PersistJiao4 天前
Couchbase UI: Search
ui·couchbase
时光追逐者4 天前
一组开源、免费、Metro风格的 WPF UI 控件库
ui·开源·c#·.net·wpf·.netcore·微软技术
专注VB编程开发20年5 天前
代替Winform、Win32控件的一些界面框架Electron,QT等
前端·c++·ui·框架·界面
军训猫猫头5 天前
58.界面参数传递给Command C#例子 WPF例子
开发语言·ui·c#·wpf