SelectionCourseSystem/src/edson/web/StuAction.java

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package edson.web;

import java.util.Iterator;
import java.util.List;

import org.junit.Test;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

import edson.bean.Admin;
import edson.bean.Course;
import edson.bean.Student;
import edson.business.serviceImpl.StuService;
import edson.utils.MD5;
import edson.utils.PageBean;


public class StuAction extends ActionSupport implements ModelDriven<Course>{
	
	public StuService stuService;
	private PageBean pb;
	private Integer num;
	private Student stu;
	public Course course=new Course();
	private String pwd1;
	private String pwd2;
	private String tea_name;//查询条件
	
	public String viewAllSelection(){
		try{
			if(num==null)num=1;
			stu=(Student) ActionContext.getContext().getSession().get("stu_user");
			pb=stuService.findSelection(num,stu.getStu_id());//查找除去已选课程外的可选课程
			pb.setPath("/stu_viewAllSelection");
			
			
			
			ActionContext.getContext().getSession().put("pb", pb);
			
			return "success_viewAllSelection";
		}catch(Exception e){
			e.printStackTrace();
			this.addActionError("操作失败,请稍候尝试!");
			return "error";
		}
		
	}
	
	public String selectCourse(){
		try{
			stu=(Student) ActionContext.getContext().getSession().get("stu_user");
			stu=stuService.findStuById(stu.getStu_id());
			course=stuService.findCourseById(course.getCourse_id());
			
			//判断是否选课名额已满
			if(course.getSelection_taken()>=course.getCapacity())return "error";
			
			
后面还有 184 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。