Package net.sf.chellow.billing

Examples of net.sf.chellow.billing.Party


      }
    } else if (roleCode.equals(UserRole.EDITOR)) {
      return;
    } else if (roleCode.equals(UserRole.PARTY_VIEWER)) {
      if (method.equals(HttpMethod.GET) || method.equals(HttpMethod.HEAD)) {
        Party party = user.getParty();
        char marketRoleCode = party.getRole().getCode();
        if (marketRoleCode == MarketRole.HHDC) {
          Long hhdcContractId = inv.getLong("hhdc-contract-id");
          if (!inv.isValid()) {
            throw new ForbiddenException(
                "Need the parameter hhdc-contract-id.");
          }
          HhdcContract hhdcContract = HhdcContract
              .getHhdcContract(hhdcContractId);
          if (!hhdcContract.getParty().equals(party)) {
            throw new ForbiddenException(
                "The party associated with the contract you're trying to view doesn't match your party.");
          }
          if ((pathInfo + "?" + inv.getRequest().getQueryString())
              .startsWith("/reports/37/output/?hhdc-contract-id="
                  + hhdcContract.getId())) {
            return;
          }
        } else if (marketRoleCode == MarketRole.SUPPLIER) {
          if (pathInfo.startsWith("/supplier-contracts/"
              + party.getId())) {
            return;
          }
        }
      }
    }
View Full Code Here


      String userRoleCode = GeneralImport.addField(csvElement,
          "User Role Code", values, 3);
      UserRole userRole = UserRole.getUserRole(userRoleCode);
      String participantCode = GeneralImport.addField(csvElement,
          "Participant Code", values, 4);
      Party party = null;
      if (participantCode.trim().length() != 0) {
        String marketRoleCode = GeneralImport.addField(csvElement,
            "Market Role Code", values, 5);
        party = Party.getParty(participantCode, marketRoleCode);
      }
View Full Code Here

      Long userRoleId = inv.getLong("user-role-id");
      UserRole userRole = UserRole.getUserRole(userRoleId);
      if (!inv.isValid()) {
        throw new UserException(document());
      }
      Party party = null;
      if (userRole.getCode().equals(UserRole.PARTY_VIEWER)) {
        Long partyId = inv.getLong("party-id");

        party = Party.getParty(partyId);
      }
View Full Code Here

    }
   
    UserRole role = UserRole.getUserRole(userRoleId);
    try {
      Hiber.setReadWrite();
      Party party = null;
      if (role.getCode().equals(UserRole.PARTY_VIEWER)) {
        Long partyId = inv.getLong("party-id");
        if (!inv.isValid()) {
          throw new UserException(document());
        }
View Full Code Here

TOP

Related Classes of net.sf.chellow.billing.Party

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.