Package br.com.buyFast.model

Examples of br.com.buyFast.model.Customer


  /**
   * Envia a mensagem de confirmação de pedido.
   * @throws ServiceException
   */
  public void sendConfirmOrder(Order order) throws ServiceException {
      Customer customer = order.getCustomer();
   
      logger.info("Enviando e-mail para " + customer);
     
      SimpleDateFormat df = new SimpleDateFormat("dd/MM/yy - HH:mm:ss");
     
      StringBuilder builder = new StringBuilder();
      NumberFormat format = NumberFormat.getCurrencyInstance();
     
      builder.append("<h2>Confirmação de pedido do site BuyFast:</h2><br />");
      builder.append("<h2>Dados do Pedido:</h2><br />");
      builder.append("<b>Hora:</b> " + df.format(new Date()) + "<br />");
      builder.append("<b>Nome:</b> " + customer.getName() + "<br />");
      builder.append("<b>E-mail:</b> " + customer.getEmail() + "<br />");
      builder.append("<b>Assunto:</b> Pedido Finalizado<br />");
      builder.append("<b>Produtos:</b><br />");
      double total = 0.0d;
      for (ItemsOrder itemsOrder : order.getItemsOrders()) {
        builder.append(itemsOrder.getQuantity());
        builder.append(" - ");
        builder.append(itemsOrder.getProduct().getName());
        builder.append(" - ");
        builder.append(format.format(itemsOrder.getPrice()));
        builder.append("<br />");
        total += itemsOrder.getPrice();
      }
      builder.append("<br /><b>Total:</b>" + format.format(total));
     
      emailService.send(customer.getEmail(), "buyfast@buyfast.com", "Pedido Finalizado no Site BuyFast",
          builder.toString());
   
  }
View Full Code Here


   * @return
   */
  public String viewBoleto() {
    // Apresentar boleto.
    try {
      Customer customer = new Customer();
      customer = this.orderBoleto.getCustomer();
      // Nova instancia do pedido.
      this.orderBoleto = new Order();
      showBoleto(customer);
    } catch (Exception e) {
View Full Code Here

   * Método responsável pelo login do usuário.
   * @return caso usuário logado, ir para a página do mesmo.
   */
  public String login() {
    //Obter o usuário cadastrado.
    Customer customer = null;
    try {
      customer = getCustomerLogin(this.customer.getEmail());
    } catch (ServiceException e) {
      String error = "Erro ao obter usuário.";
      logger.error(error, e);
      FacesUtil.mensErro("", FacesUtil.getMessage("customerControllerErrorgetCustomer"));
      return null;
    }
   
    //verificar usuário e senha.
    if (customer != null && customer.getPassword().equals(this.customer.getPassword())) {
      //Cria uma nova sessão.
      session.setAttribute("user", customer);
     
      //Seta o usuário.
      this.customer = customer;
View Full Code Here

 
  /**
   * Utilizado para "resetar" customer.
   */
  private void resetCustomer() {
    this.customer = new Customer();
    this.customer.setAddress(new Address());
  }
View Full Code Here

TOP

Related Classes of br.com.buyFast.model.Customer

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.