Exemplo n.º 1
0
  // Saves a new group
  public void insertSave() {
    GroupDAO gm = DataAccessDriver.getInstance().newGroupDAO();

    Group g = new Group();
    g.setDescription(this.request.getParameter("group_description"));
    g.setParentId(this.request.getIntParameter("parent_id"));
    g.setName(this.request.getParameter("group_name"));

    gm.addNew(g);

    this.list();
  }
Exemplo n.º 2
0
  // Save information for an existing group
  public void editSave() {
    int groupId = this.request.getIntParameter("group_id");

    Group g = new Group();
    g.setDescription(this.request.getParameter("group_description"));
    g.setId(groupId);

    int parentId = this.request.getIntParameter("parent_id");

    if (parentId == g.getId()) {
      parentId = 0;
    }

    g.setParentId(parentId);
    g.setName(this.request.getParameter("group_name"));

    DataAccessDriver.getInstance().newGroupDAO().update(g);

    this.list();
  }