Examples of CustomerAccount


Examples of com.alexnevsky.hotel.model.CustomerAccount

   * @throws DAOException
   *             If something fails at database level.
   */
  public Customer getCustomer(String login, String password) throws DAOException {
    AbstractDAOFactory daoFactory = Controller.getDAOFactory();
    CustomerAccount customerAccount = daoFactory.getCustomerAccountDAO().find(login, password);
    Customer customer = daoFactory.getCustomerDAO().find(customerAccount.getId());
    return customer;
  }
View Full Code Here

Examples of com.alexnevsky.hotel.model.CustomerAccount

   */
  private CustomerAccount find(String sql, Object... values) throws DAOException {
    Connection connection = null;
    PreparedStatement preparedStatement = null;
    ResultSet resultSet = null;
    CustomerAccount customerAccount = null;

    try {
      connection = this.daoFactory.getConnection();
      preparedStatement = prepareStatement(connection, sql, false, values);
      resultSet = preparedStatement.executeQuery();
View Full Code Here

Examples of com.alexnevsky.hotel.model.CustomerAccount

   * @return The mapped CustomerAccount from the current row of the given ResultSet.
   * @throws SQLException
   *             If something fails at database level.
   */
  private static CustomerAccount mapCustomerAccount(ResultSet resultSet) throws SQLException {
    return new CustomerAccount(resultSet.getLong("id"), resultSet.getString("login"),
        resultSet.getString("password"));
  }
View Full Code Here

Examples of com.tll.model.CustomerAccount

  @Transactional
  @Override
  public CustomerAccount persist(final CustomerAccount entity) throws EntityExistsException,
      ConstraintViolationException {
    final CustomerAccount pe = super.persist(entity);
    if(pe != null) {
      if(entity.isNew()) {
        addHistoryRecord(new AccountHistoryContext(AccountHistoryOp.CUSTOMER_ACCOUNT_ADDED, pe));
      }
    }
View Full Code Here

Examples of com.tll.model.CustomerAccount

    return pec;
  }

  @Override
  public CustomerAccount persist(CustomerAccount entity) throws EntityExistsException, ConstraintViolationException {
    final CustomerAccount pe = super.persist(entity);
    if(pe != null) {
      if(entity.isNew()) {
        addHistoryRecord(new AccountHistoryContext(AccountHistoryOp.CUSTOMER_ACCOUNT_ADDED, pe));
      }
    }
View Full Code Here

Examples of com.zesped.model.CustomerAccount

 
  @DefaultHandler
  public Resolution form() {   
    try {
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        CustomerAccount cacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        clients=cacc.clients(getSession()).list(getSession());
        disconnect();
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
      } finally {
        close();
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    } else if (sBusinessName.length()==0) {
      addError(new LocalizableError("com.zesped.action.SaveClient.businessName.valueNotPresent"));
    } else {
      try {
        connect();
        CustomerAccount oAcc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        TaxPayer oFoundTaxPayer = oAcc.taxpayers(getSession()).seek(getSession(), sBusinessName);
        if (!oFoundTaxPayer.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.businessNameAlreadyExists"));
        oFoundTaxPayer = oAcc.taxpayers(getSession()).seek(getSession(), sTaxId);
        if (!oFoundTaxPayer.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.taxIdAlreadyExists"));
      } catch (ElementNotFoundException clientnotfound) {
      } catch (Exception e) {
        Log.out.error("SaveTaxPayer.validateBusinessName("+sBusinessName+") "+e.getClass().getName()+" "+e.getMessage(), e);
View Full Code Here

Examples of com.zesped.model.CustomerAccount

        connect();
        if (sFormerId.length()>0) {
            oTxpr = new TaxPayer();
            oTxpr.load(getSession(), sFormerId);
        } else {
            CustomerAccount oCacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
            oTxpr = TaxPayer.create(getSession(), oCacc, getParam("taxPayer.businessName"), getParam("taxPayer.contactPerson"), getParam("taxPayer.email"), DAO.getVolumesMountBase());
        }
        saveRequest(oTxpr);
        disconnect();
          addDataLine("id",oTxpr.id());
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    } else if (sBusinessName.length()==0) {
      addError(new LocalizableError("com.zesped.action.SaveClient.businessName.valueNotPresent"));
    } else {
      try {
        connect();
        CustomerAccount oAcc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        Client oFoundClient = oAcc.clients(getSession()).seek(getSession(), sBusinessName);
        if (!oFoundClient.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.businessNameAlreadyExists"));
        oFoundClient = oAcc.clients(getSession()).seek(getSession(), sTaxId);
        if (!oFoundClient.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.taxIdAlreadyExists"));
      } catch (ElementNotFoundException clientnotfound) {
      } catch (Exception e) {
        Log.out.error("SaveClient.validateBusinessName("+sBusinessName+") "+e.getClass().getName()+" "+e.getMessage(), e);
View Full Code Here

Examples of com.zesped.model.CustomerAccount

        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        if (sFormerId.length()>0) {
            oClnt = new Client();
            oClnt.load(getSession(), sFormerId);
        } else {
            CustomerAccount oCacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
            oClnt = new Client(getSession(), oCacc.clients(getSession()));
        }
        saveRequest(oClnt);
        disconnect();
          addDataLine("id",oClnt.id());
      } catch (Exception xcpt) {
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.