Package cz.muni.fi.pa165.stis.dto

Examples of cz.muni.fi.pa165.stis.dto.CustomerTO


       
        RepeatingView repeating = new RepeatingView("repeating");
        add(repeating);
        ReservationService reservationService = (ReservationService) ApplicationContextProvider.getApplicationContext().getBean("reservationService");
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
        AuthenticatedSession session = ((AuthenticatedSession)Session.get());
        List<ReservationTO> list = reservationService.findReservationsByReader(session.getReader());
        if(list != null){
            for (ReservationTO reservation : list) {
                AbstractItem item = new AbstractItem(repeating.newChildId());
                PageParameters pageParameters = new PageParameters();
                item.add(new BookmarkablePageLink<Void>("delete", ShowAllReservation.class, pageParameters));
View Full Code Here


        if (session.getUser()!=null){
            add(new Label("user",session.getUser()));
            add(new Label("login",new Model("")));
           add(new BookmarkablePageLink<>("logout", Logout.class));
           if (session.getCheckAdmin()){
                add(new MenuAdminPanel("menuPanel"));
            }else {
                add(new MenuReaderPanel("menuPanel"));
            }
        }else {
            add(new Label("user",""));
View Full Code Here

            add(new Label("login",new Model("")));
           add(new BookmarkablePageLink<>("logout", Logout.class));
           if (session.getCheckAdmin()){
                add(new MenuAdminPanel("menuPanel"));
            }else {
                add(new MenuReaderPanel("menuPanel"));
            }
        }else {
            add(new Label("user",""));
            add(new BookmarkablePageLink<>("login", Login.class));
            add(new Label("logout",new Model("")));
View Full Code Here

    @Test
    public void testGet() {
        customer.setId(1L);
        customerTO.setId(1L);
        when(dao.get(1L)).thenReturn(customer);
        CustomerTO ct = service.get(1L);
       
        assertEquals(ct, customerTO);
    }
View Full Code Here

    }
   
    public Resolution findByCustomer() {
        try {
            Long id = Long.parseLong(getContext().getRequest().getParameter("customerId"));
            CustomerTO customer = custService.get(id);
            if (customer != null) {
                result = service.findByCustomer(customer);
            }
        } catch (NumberFormatException ex) {
            result = new ArrayList<>();
View Full Code Here

    public CustomerTO getByUsername(String username) {
        if (username == null || username.equals("")) {
            throw new IllegalArgumentException("null or empty username");
        }
        Customer customer = dao.getByUsername(username);
        CustomerTO customerTO = mapper.map(customer, CustomerTO.class);
        return customerTO;
    }
View Full Code Here

    public CustomerUserTO getByCustomerId(Long id) {
        if (id == null) {
            throw new IllegalArgumentException("id is null");
        }
       
        CustomerTO cto = cservice.get(id);
        UserTO uto = cto.getUser();       
        return new CustomerUserTO(cto, uto);
    }
View Full Code Here

        if (customerUserTO.getUser().getId() == null) {
            throw new IllegalArgumentException("user.id is null");
        }
       
        UserTO userTO = customerUserTO.getUser();       
        CustomerTO customerTO = customerUserTO.getCustomer();       
       
        customerTO.setUser(userTO);      
        uservice.update(userTO);
        cservice.update(customerTO);
    }
View Full Code Here

    }

    @Override
    public CustomerUserTO getByUsername(String username) {
        UserTO userTO = uservice.getByUsername(username);       
        CustomerTO customerTO = cservice.getByUsername(username);
       
        return new CustomerUserTO(customerTO, userTO);
    }
View Full Code Here

        customerTO.setUser(userTO)
               
        User user2 = createUser("ferko22", "bak!s$#", false);
        UserTO userTO2 = mapper.map(user2, UserTO.class);       
        Customer customer2 = createCustomer(null, "Petko", "Mravcek", "Teplicka nad Vahom 142", "772222222");
        CustomerTO customerTO2 = mapper.map(customer2, CustomerTO.class);       
        CustomerUserTO customerUserTO2 = new CustomerUserTO(customerTO2, userTO2);
        customerTO2.setUser(userTO2)
       
        List<CustomerTO> customerList = new ArrayList<>();
        customerList.add(customerTO);
        customerList.add(customerTO2);
       
View Full Code Here

TOP

Related Classes of cz.muni.fi.pa165.stis.dto.CustomerTO

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.