Examples of Customer


Examples of net.helipilot50.stocktrade.shared.Customer

     * @param pQuantity Type: int
     * @param pPrice Type: float
     */
    public void decrementHolding(String pCustomerName, String pStockName, int pQuantity, float pPrice) {
        try {
            Customer oneCustomer = null;
            Holding custHolding = null;
            float incomeFromStock = pQuantity*pPrice;
   
            oneCustomer = this.getCustomer(pCustomerName);
            //custHolding = self.GetHolding(pCustomer=oneCustomer,
            //        pGetHoldStockName=pStockName);
            custHolding = customerDAO.SQLSelectHolding(pCustomerName, pStockName);
   
            if (custHolding.getQuantity() > pQuantity) {
                custHolding.setQuantity(custHolding.getQuantity()-pQuantity);
                oneCustomer.setCashBalance(oneCustomer.getCashBalance()+incomeFromStock);
                customerDAO.SQLUpdateHolding(custHolding);
                customerDAO.SQLUpdateCashBal(oneCustomer.getCustomerName(), oneCustomer.getCashBalance());
   
            }
            else if (custHolding.getQuantity() == pQuantity) {
              customerDAO.SQLDeleteHolding(custHolding);
   
                //oneCustomer.HoldingList.DeleteRow(object=custHolding);
                oneCustomer.setCashBalance(oneCustomer.getCashBalance()+incomeFromStock);
                customerDAO.SQLUpdateCashBal(oneCustomer.getCustomerName(), oneCustomer.getCashBalance());
   
            }
            else if (custHolding.getQuantity() < pQuantity) {
                InvalidTradeException badOrder = new InvalidTradeException("Customer "+pCustomerName+" does not own enough stock to place SELL Order");
                throw badOrder;
View Full Code Here

Examples of net.sf.czarrental.bl.reservation.Customer

    }
  }

  @Override
  public Customer readCustomer(int id) {
    Customer customer = null;
    Transaction tx = null;
    try {
      Session session = SessionFactoryUtil.getInstance()
          .getCurrentSession();
      tx = session.beginTransaction();
View Full Code Here

Examples of net.sf.laja.example.repository.behaviour.domain.Customer

        //    We could have called isValid() before calling asCustomerList() to validate the list
        //    (an IllegalStateException is thrown if the state is invalid when calling asCustomerList).
        CustomerList customers = customerRepository.findBySurname("Karlsson").asCustomerList();

        // 2. Take the first customer and edit it in the GUI.
        Customer customer = customers.get(0);
        CustomerInGui customerInGui = customer.asCustomerInGui();

        customerInGui.setAge("-1");
        System.out.println("Edit in GUI, is valid: " + customerInGui.isValid());
        customerInGui.setAge("20");
        System.out.println("Edit in GUI, is valid: " + customerInGui.isValid());

        // 3. Save to database.
        customer.asCustomerInDb().save();
    }
View Full Code Here

Examples of net.virtuemart.www.customers.Customer

    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof Customer)) {
            return false;
        }
        Customer other = (Customer) obj;
        if (obj == null) {
            return false;
        }
        if (this == obj) {
            return true;
View Full Code Here

Examples of no.ugland.utransprod.model.Customer

  private void setCustomerSearchData(Order order, WindowInterface dialog,
      OrderModel orderModel) throws ProTransException {
    if (orderModel.getCustomerNr() != null
        || orderModel.getCustomerFirstName() != null
        || orderModel.getCustomerLastName() != null) {
      Customer customer = new Customer();
      try {
        if (orderModel.getCustomerNr() != null
            && orderModel.getCustomerNr().length() != 0) {
          customer.setCustomerNr(Integer.valueOf(orderModel
              .getCustomerNr()));
        }
      } catch (NumberFormatException e) {
        throw new ProTransException("Kundenr m� v�re tall");

      }
      customer.setFirstName(orderModel.getCustomerFirstName());
      customer.setLastName(orderModel.getCustomerLastName());
      order.setCustomer(customer);
    }
  }
View Full Code Here

Examples of openbook.domain.Customer

        Integer stockMax = PropertyHelper.getInteger(config, "openbook.Inventory.Max", STOCK_RANGE.getMaximum());
        Integer stockMin = PropertyHelper.getInteger(config, "openbook.Inventory.Min", STOCK_RANGE.getMinimum());
       
        System.err.println("Creating " + nCustomer + " new Customer");
        for (int i = 1; i < nCustomer; i++) {
            Customer customer = new Customer();
            customer.setName("Customer-"+i);
            em.persist(customer);
        }

        List<Author> allAuthors = new ArrayList<Author>();
        System.err.println("Creating " + nAuthor + " new Authors");
View Full Code Here

Examples of org.agoncal.application.petstore.domain.Customer

            callbackHandler.handle(new Callback[]{nameCallback, passwordCallback});
            String username = nameCallback.getName();
            String password = new String(passwordCallback.getPassword());
            nameCallback.setName("");
            passwordCallback.clearPassword();
            Customer customer = customerService.findCustomer(username, password);

            if (customer == null) {
                throw new LoginException("Authentication failed");
            }
View Full Code Here

Examples of org.apache.bval.jsr303.example.Customer

        assertDefaultBuilderAndFactory(builder);

        ValidatorFactory factory = builder.buildValidatorFactory();
        Validator validator = factory.getValidator();

        Customer customer = new Customer();
        customer.setFirstName("John");

        Set<ConstraintViolation<Customer>> ConstraintViolations = validator.validate(customer);
        Assert.assertFalse(ConstraintViolations.isEmpty());

        builder = Validation.byDefaultProvider().configure();
View Full Code Here

Examples of org.apache.camel.component.cxf.jaxrs.simplebinding.testbean.Customer

                        assertNotNull(exchange.getIn().getHeader("id"));
                        long id = exchange.getIn().getHeader("id", Long.class);
                        if (id == 123) {
                            assertEquals("123", exchange.getIn().getHeader("id"));
                            assertEquals(MessageContentsList.class, exchange.getIn().getBody().getClass());
                            exchange.getOut().setBody(new Customer(123, "Raul"));
                            exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 200);
                        } else if (id == 456) {
                            exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 404);                                       
                        } else {
                            fail();
                        }
                    }
                });
                           
                from("direct:updateCustomer").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        assertEquals("123", exchange.getIn().getHeader("id"));
                        Customer c = exchange.getIn().getBody(Customer.class);
                        assertEquals(123, c.getId());
                        assertNotNull(c);
                    }
                });
                       
                from("direct:newCustomer").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        Customer c = exchange.getIn().getBody(Customer.class);
                        assertNotNull(c);
                        assertEquals(123, c.getId());
                    }
                });
               
                from("direct:listVipCustomers").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        assertEquals("gold", exchange.getIn().getHeader("status", String.class));
                        assertEquals(MessageContentsList.class, exchange.getIn().getBody().getClass());
                        assertEquals(0, exchange.getIn().getBody(MessageContentsList.class).size());
                        CustomerList response = new CustomerList();
                        List<Customer> list = new ArrayList<Customer>(2);
                        list.add(new Customer(123, "Raul"));
                        list.add(new Customer(456, "Raul2"));
                        response.setCustomers(list);
                        exchange.getOut().setBody(response);
                    }
                });
               
                from("direct:updateVipCustomer").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        assertEquals("gold", exchange.getIn().getHeader("status", String.class));
                        assertEquals("123", exchange.getIn().getHeader("id"));
                        Customer c = exchange.getIn().getBody(Customer.class);
                        assertEquals(123, c.getId());
                        assertNotNull(c);
                    }
                });
               
                from("direct:deleteVipCustomer").process(new Processor() {
View Full Code Here

Examples of org.apache.camel.component.cxf.jaxrs.testbean.Customer

                    // set the relative path
                    inMessage.setHeader(Exchange.HTTP_PATH, "/customerservice/customersUniqueResponseCode");               
                    // put the response's entity into out message body
                    inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Customer.class);
                    // create a new customer object
                    Customer customer = new Customer();
                    customer.setId(8888);
                    customer.setName("Willem");
                    inMessage.setBody(customer);               
                }
            });
       
        // get the response message
        Customer response = (Customer) exchange.getOut().getBody();
        assertNotNull("The response should not be null ", response);
        assertTrue("Get a wrong customer id ", response.getId() != 8888);
        assertEquals("Get a wrong customer name", response.getName(), "Willem");
        assertEquals("Get a wrong response code", 201, exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE));
    }
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.