Package ch.bfh.egov.internetapps.tos

Examples of ch.bfh.egov.internetapps.tos.Modul


      throws Exception {

    DynaActionForm f = (DynaActionForm) form;
    Integer planned = (Integer) f.get("geplant");

    Modul m = new Modul();
    m.setMandantId((Integer) request.getSession().getAttribute(Constants.MANDANT_ID));
    m.setBranchensichtId(getBranchensichtId(request, f));
    m.setGeplant(planned);
    service.deleteAssignments(m);

    if(planned > 0)
      planned--;
    f.set("geplant", planned);
    request.setAttribute("geplant", planned);
    f.set(Constants.BRANCHENSICHT_ID, m.getBranchensichtId());

    service.populate(request, f);

    if(planned > 0) {
      Branchensicht b = new Branchensicht();
      b.setMandantId(m.getMandantId());
      b.setBranchensichtId(m.getBranchensichtId());
      Integer total = service.getRecordCount(b)-1;
      if(total < planned)
        total = planned;
      request.setAttribute("totalgeplant", total);
    }
View Full Code Here


      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    DynaActionForm mForm = (DynaActionForm) form;
    if(isUpdate(request, mForm)) {
        Modul m = new Modul();
        m.setModulId((Integer) mForm.get("modulId"));
        m.setMandantId((Integer) request.getSession().getAttribute(Constants.MANDANT_ID));
        m = service.getById(m);
        mForm.set("name", m.getName());
        mForm.set("punkte", m.getPunkte());
        mForm.set("update", true);
    }
    return mapping.findForward("edit");
  }
View Full Code Here

      }
      saveMessages(request, errors);
      return mapping.findForward("adminfailure");
    }

    Modul m = new Modul();
    m.setModulId(modulId);
    m.setMandantId(mandantId);
    m.setName(name);
    m.setPunkte(punkte);

    // update?
    if (isUpdate(request, f))
      service.update(m);
    // insert
View Full Code Here

      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    DynaActionForm f = (DynaActionForm) form;
    Modul m = new Modul();
    m.setModulId((Integer) f.get("modulId"));
    m.setMandantId((Integer) request.getSession().getAttribute(Constants.MANDANT_ID));
    m = service.getById(m);

    if(m == null) {
      service.populate(request, f);
      return mapping.findForward(Constants.LIST);
    }

    ActionMessages messages = new ActionMessages();
    messages.add(ActionMessages.GLOBAL_MESSAGE,
        new ActionMessage("messages.question.delete", m.getName()));
    saveMessages(request, messages);
    request.setAttribute(Constants.ACTION, Constants.MODUL_ACTION);
    request.setAttribute(Constants.DISPATCH_YES, Constants.DELETE);
    request.setAttribute(Constants.DISPATCH_NO, Constants.LIST);
    request.setAttribute(Constants.ID_NAME, Constants.MODUL_ID);
    request.setAttribute(Constants.ID_VALUE, m.getModulId());
    return mapping.findForward(Constants.QUESTION);
  }
View Full Code Here

      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    DynaActionForm f = (DynaActionForm) form;
    Modul m = new Modul();
    m.setModulId((Integer) f.get("modulId"));
    m.setMandantId((Integer) request.getSession().getAttribute(Constants.MANDANT_ID));
    m = service.getById(m);
    if(m == null) {
      service.populate(request, f);
      return mapping.findForward(Constants.LIST);
    }
View Full Code Here

    // Module zuweisen
    logger.debug("Module angew�hlt: " + modulIds.length);
    List<Modul> module = new ArrayList<Modul>();
    Double punkte = 0.0;
    for(int i = 0; i < modulIds.length; i++) {
      Modul m = new Modul();
      m.setModulId(modulIds[i]);
      m.setMandantId((Integer) request.getSession().getAttribute(Constants.MANDANT_ID));
      m = service.getById(m);
      m.setBranchensichtId(b.getBranchensichtId());
      m.setGeplant(planned);
      logger.debug((planned == 0) ? "Aktueller Stand" : "Geplanter Stand " + planned);
      logger.debug("F�ge Modul " + m.getModulId() + " hinzu.");
      module.add(m);
      punkte += m.getPunkte();
    }
    service.setModule(module, b, planned);
  }
View Full Code Here

   *
   * @param mandantId   die Id des Mandanten
   * @return            Liste aller Module
   */
  public List<Modul> getAssigned(Branchensicht b, Integer planned) {
    Modul m = new Modul();
    m.setMandantId(b.getMandantId());
    m.setBranchensichtId(b.getBranchensichtId());
    m.setGeplant(planned);
    return queryForList("Modul.getAssigned", m);
  }
View Full Code Here

   *
   * @param b        Branchensicht-Objekt mit ben�tigten Daten
   * @param planned  Gibt den Planungsstand an, der gel�scht werden soll (0 = aktueller Stand)
   */
  public void deleteAssignedModules(Integer branchensichtId, Integer planned) {
    Modul m = new Modul();
    m.setBranchensichtId(branchensichtId);
    m.setGeplant(planned);
    delete("Modul.deleteAssignedModules", m);
  }
View Full Code Here

   * @param branchensichtId  die Id der Branchensicht
   * @param planned          geplanter Stand (0 = aktueller Stand)
   * @return                 Punktzahl
   */
  public Integer getPoints(Integer branchensichtId, Integer planned) {
    Modul m = new Modul();
    m.setBranchensichtId(branchensichtId);
    m.setGeplant(planned);
    return ((Integer) queryForObject("Branchensicht.getPoints", m));
  }
View Full Code Here

TOP

Related Classes of ch.bfh.egov.internetapps.tos.Modul

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.