Ejemplo n.º 1
0
  private void editGoal(HttpServletRequest request, HttpServletResponse response)
      throws IOException {

    HttpSession session = request.getSession();
    Goal goal = (Goal) session.getAttribute("goal");
    if (goal == null) {
      response.sendRedirect("goal.jspx?m=login");
    } else {
      String gdesc = request.getParameter("gdesc");

      Goal g = new Goal();
      g.setId(goal.getId());
      g.setGname(goal.getGname());
      g.setGdesc(gdesc);
      g.setProjectid(goal.getProjectid());
      g.setGcreatetime(goal.getGcreatetime());
      GoalService gservice = new GoalService();
      gservice.update(g);

      Project project = (Project) session.getAttribute("project");
      Employee e = (Employee) session.getAttribute("employee");
      Message m = new Message();
      m.setId(PKUtil.getId());
      m.setContent("修改了目标:" + goal.getGname());
      m.setLink("");
      m.setMcreatetime(DateUtil.getNow());
      m.setProjectid(project.getId());
      m.setEmployeeid(e.getId());

      MessageService mservice = new MessageService();
      mservice.save(m);

      response.sendRedirect("goal.jspx?m=login");
    }
  }
Ejemplo n.º 2
0
    public IdeaComment mapperRow(ResultSet rs) throws SQLException {
      IdeaComment ic = new IdeaComment();
      ic.setId(rs.getString("id"));
      ic.setContent(rs.getString("content"));
      ic.setCreatetime(rs.getString("createtime"));
      ic.setIdeaid(rs.getString("ideaid"));
      ic.setEmployeeid(rs.getString("employeeid"));

      Employee e = new Employee();
      e.setId(rs.getString("employeeid"));
      e.setUsername(rs.getString("username"));
      e.setPassword(rs.getString("password"));
      ic.setEmployee(e);
      return ic;
    }