Examples of ChargeForm


Examples of net.sf.pmr.struts.agilePlanning.charge.form.ChargeForm

        // get the service
        StoryService storyService = AgilePlanningObjectFactory.getStoryService();

        // populate the form
        ChargeForm chargeForm = (ChargeForm) form;
        chargeForm.setStoryPersistanceId(Integer.parseInt((String) request.getParameter("storyPersistanceId")));
        chargeForm.setTaskPersistanceId(Integer.parseInt((String) request.getParameter("taskPersistanceId")));
       
        // find the Story... if needed
        if (StringUtils.isNotEmpty((String) request.getParameter("persistanceId"))) {

            Charge charge = storyService.findChargeByPersistanceId(Integer.parseInt((String) request.getParameter("persistanceId")));

            chargeForm.setDay(charge.getDay());
            chargeForm.setDaysNeededToFinish(charge.getDaysNeededToFinish());
            chargeForm.setTimeUsedToday(charge.getTimeUsedToday());
            chargeForm.setPersistanceVersion(charge.getPersistanceVersion());
           
        }   
   
        // populate summary
        populateSummary(request, chargeForm.getStoryPersistanceId(), chargeForm.getTaskPersistanceId());

        return mapping.findForward("chargeDetail");

    }
View Full Code Here

Examples of net.sf.pmr.struts.agilePlanning.charge.form.ChargeForm

        // get the service
        StoryService storyService = AgilePlanningObjectFactory.getStoryService();

        // get the form
        ChargeForm chargeForm = (ChargeForm) form;

        // TODO faire une seul m�thode taskService.save ?
        // save the story
        if (chargeForm.getPersistanceId() == 0) {
            // add
            storyService.addCharge(chargeForm.getStoryPersistanceId(),
                            chargeForm.getTaskPersistanceId(),
                            ((User) request.getSession().getAttribute("user")).getPersistanceId(),
                            chargeForm.getDay(),
                            chargeForm.getTimeUsedToday(),
                            chargeForm.getDaysNeededToFinish());
        } else {
            // update
            storyService.updateCharge(chargeForm.getDay(),
                          chargeForm.getTimeUsedToday(),
                          chargeForm.getDaysNeededToFinish(),
                          chargeForm.getStoryPersistanceId(),
                          chargeForm.getTaskPersistanceId(),
                          chargeForm.getPersistanceId(),
                          chargeForm.getPersistanceVersion());
        }

           
        // set the storyPersistanceId in request
        request.setAttribute("storyPersistanceId", String.valueOf(chargeForm.getStoryPersistanceId()));
           
         return this.list(mapping, form, request, response);

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.