Example #1
0
  public String save() {
    Dept dept = deptService.findById(deptId);
    employee.setDept(dept);
    employeeService.save(employee);

    return "listAction";
  }
Example #2
0
 // 进入修改界面
 public String viewUpdate() {
   // 查到所有部门
   List<Dept> listDept = deptService.getAll();
   request.put("listDept", listDept);
   // 根据点击进入更新页面获得的参数id,查到需要修改的员工的初始信息
   int id = employee.getId();
   Employee emp = employeeService.findById(id);
   ValueStack vsStack = ActionContext.getContext().getValueStack();
   // 移除栈顶
   vsStack.pop();
   // 把获得的员工信息加入栈
   vsStack.push(emp);
   return "edit";
 }
Example #3
0
 /** 2.进入添加员工页面 */
 public String viewAdd() {
   // 先查出所有部门在添加员工的时候可以选择部门
   List<Dept> listDept = deptService.getAll();
   request.put("listDept", listDept);
   return "add";
 }