public void initializeOptions() {
   countries = new HashMap<String, String>();
   currencies = new HashMap<String, String>();
   for (String str : MonitoringServiceDAO.getInstance().getCountryList()) {
     countries.put(str, str);
   }
   for (String str : MonitoringServiceDAO.getInstance().getCurrencyList()) {
     currencies.put(str, str);
   }
   for (String str : CountryDAO.getInstance().getCountryList()) {
     countries.put(str, str);
   }
   for (String str : CountryDAO.getInstance().getCurrencyList()) {
     currencies.put(str, str);
   }
 }
 /**
  * delete a user and inserts audit
  *
  * @return
  */
 public String deleteMonitoringService() {
   if (this.selectedremotemonitoringService != null) {
     MonitoringServiceDAO.getInstance()
         .deleteMonitoringService(this.selectedremotemonitoringService.getId());
     UserAuditDAO.getInstance()
         .addUserAudit(
             "Delete Monitoring Service",
             "User deleted the monitoring service :"
                 + this.selectedremotemonitoringService.getCountry());
   }
   return "MonitoringServicesPage?faces-redirect=true";
 }
  public String saveCosts() {
    if (this.selectedremotemonitoringService != null) {
      MonitoringServiceDAO.getInstance()
          .updateMonitoringServiceCosts(this.selectedremotemonitoringService);
      //
      selectedremotemonitoringService.removeMonitoringServiceCosts();
      selectedremotemonitoringService.addMonitoringServiceCosts(
          MonitoringServiceDAO.getInstance()
              .getMonitoringServiceCosts(
                  selectedremotemonitoringService.getId(),
                  selectedremotemonitoringService.getStepvalue1(),
                  selectedremotemonitoringService.getStepvalue2(),
                  selectedremotemonitoringService.getStepvalue3(),
                  selectedremotemonitoringService.getStepvalue4(),
                  selectedremotemonitoringService.getStepvalue5()));
      oneYearOption =
          selectedremotemonitoringService.getMonitoringCostsList().get(0).getOneYearlyCosts();
      MonitoringServiceDAO.getInstance()
          .updateMonitoringServiceCosts(this.selectedremotemonitoringService);

      //
    }
    return "MonitoringServicesCostsPage?faces-redirect=true";
  }
 /**
  * adds a new user and inserts audit
  *
  * @return
  */
 public String addNewMonitoringService() {
   MonitoringServiceDAO.getInstance()
       .addMonitoringService(
           this.newremotemonitoringService.getThreeyeardisc(),
           this.newremotemonitoringService.getFiveyeardisc(),
           this.newremotemonitoringService.getFactor2(),
           this.newremotemonitoringService.getCountry(),
           this.newremotemonitoringService.getCurrency(),
           this.newremotemonitoringService.getDescription(),
           this.newremotemonitoringService.getStepvalue1(),
           this.newremotemonitoringService.getStepvalue2(),
           this.newremotemonitoringService.getStepvalue3(),
           this.newremotemonitoringService.getStepvalue4(),
           this.newremotemonitoringService.getStepvalue5());
   UserAuditDAO.getInstance()
       .addUserAudit(
           "Add Monitoring Service",
           "User added the monitoring service : " + this.newremotemonitoringService.getCountry());
   newremotemonitoringService = new MonitoringService();
   return "MonitoringServicesPage?faces-redirect=true";
 }
 /**
  * modify a user and inserts audit
  *
  * @return
  */
 public String modifyMonitoringService() {
   if (this.selectedremotemonitoringService != null) {
     MonitoringServiceDAO.getInstance()
         .modifyMonitoringService(
             this.selectedremotemonitoringService.getThreeyeardisc(),
             this.selectedremotemonitoringService.getFiveyeardisc(),
             this.selectedremotemonitoringService.getFactor2(),
             this.selectedremotemonitoringService.getCountry(),
             this.selectedremotemonitoringService.getCurrency(),
             this.selectedremotemonitoringService.getId(),
             this.selectedremotemonitoringService.getDescription(),
             this.selectedremotemonitoringService.getStepvalue1(),
             this.selectedremotemonitoringService.getStepvalue2(),
             this.selectedremotemonitoringService.getStepvalue3(),
             this.selectedremotemonitoringService.getStepvalue4(),
             this.selectedremotemonitoringService.getStepvalue5());
     UserAuditDAO.getInstance()
         .addUserAudit(
             "Modify Monitoring Service",
             "User modified the monitoring service : "
                 + this.selectedremotemonitoringService.getCountry());
   }
   return "MonitoringServicesPage?faces-redirect=true";
 }
 public void setRemotemonitoringservicesList() {
   this.remotemonitoringservicesList =
       MonitoringServiceDAO.getInstance().getMonitoringServicesList();
 }