Package domain

Examples of domain.Client


        List<ReceptionGroup> lines = new ArrayList<ReceptionGroup>();
        List<SheduleReception> receptions = getDao().getList(queryCriteria, null, null);

        HashMap<Integer, ReceptionGroup> map = new HashMap<Integer, ReceptionGroup>();
        for (SheduleReception reception : receptions) {
            Client client = reception.getClient();
            Address address = null;
            if (client.getAddressID() != null) {
                address = getDao().getById(Address.class, client.getAddressID());
            }
            ReceptionGroup group = map.get(client.getId());
            if (group == null) {
                group = new ReceptionGroup();
                lines.add(group);
                map.put(client.getId(), group);
                group.client = client;
                group.addressClient = address != null ? address.getAsStringShort() : "";
                group.receptionLines = new ArrayList<ReceptionLine>();
            }
View Full Code Here


        }
        if (requested == null) {
            return new ModelAndView("redirect:/operator/request/index.htm");
        }

        Client client = new Client();
        client.setSurname(getDirectoryItem(Surname.class, requested.getSurname()));
        client.setName(getDirectoryItem(Name.class, requested.getName()));
        client.setPatronymic(getDirectoryItem(Patronymic.class, requested.getPatronymic()));
        client.setBorn(requested.getBornDate());
        client.setSex(requested.getSex());
        client.setTelephones(requested.getPhoneNumber());
        client.setAddressID(requested.getAddress().getId());
        client.setAddressCashe(requested.getAddress().getAsStringCashe());
        client.setDistrict(requested.getDistrict());
        getDao().save((EntityWithId)client);

        UserClient userClient = new UserClient();
        userClient.setUserClientPK(new UserClientPK(getUserInfo().getLogin(), client.getId()));
        userClient.setClient(client);
        userClient.setUserLogin(requested.getRequesterLogin());
        getDao().save(userClient);

        getDao().delete(requested);

        return new ModelAndView("redirect:/operator/client.htm?client=" + client.getId());
    }
View Full Code Here

    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
        String clientStr = request.getParameter("client");
        if (clientStr == null || clientStr.isEmpty()) {
            return new ModelAndView("redirect:/operator/request/index.htm");
        }
        Client client = null;
        try {
            client = CH.get(getDao(), Client.class, clientStr);
        } catch (Exception ex) {
        }
        if (client == null) {
            return new ModelAndView("redirect:/operator/request/index.htm");
        }

        String requestedStr = request.getParameter("clientrequested");
        if (requestedStr == null || requestedStr.isEmpty()) {
            return new ModelAndView("redirect:/operator/request/index.htm");
        }
        UserRequest requested = null;
        try {
            requested = CH.get(getDao(), UserRequest.class, requestedStr);
        } catch (Exception ex) {
        }
        if (requested == null) {
            return new ModelAndView("redirect:/operator/request/index.htm");
        }

        UserClient userClient = new UserClient();
        userClient.setUserClientPK(new UserClientPK(getUserInfo().getLogin(), client.getId()));
        userClient.setClient(client);
        userClient.setUserLogin(requested.getRequesterLogin());
        getDao().save(userClient);

        return new ModelAndView("redirect:/operator/request/index.htm");
View Full Code Here

        //end check DTO

        Message mss = new Message();
        mss.setClient(dto.getClient());
        mss.setDate(new Date());
        Client sender = getDao().getById(Collaborator.class, getUserInfo().getCurrentCollaboratorId()).getClient();
        mss.setSender(sender);
        mss.setSubject(dto.getSubject());
        mss.setText(dto.getText());
        getDao().save(mss);
        return new ModelAndView("redirect:/operator/message/outbox.htm");
View Full Code Here

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
        HashMap model = new HashMap();
        ArrayList<Message> messages = new ArrayList<Message>();
        //Выбираем сообщеня по залогиненому пользователю
        Client client = getDao().getById(Collaborator.class, getUserInfo().getCurrentCollaboratorId()).getClient();
        DetachedCriteria criteria = DetachedCriteria.forClass(Message.class);
        criteria.add(Property.forName("client").eq(client));
        List<Message> messageList = getDao().getList(criteria, 0, 0);
        messages.addAll(messageList);
        model.put("messages", messages);
View Full Code Here

        SelectClientDTO dto = (SelectClientDTO) command;
        HashMap model = new HashMap();
        model.put("command", dto);

        //инициализация полей, если клиент уже задан
        Client predefClients = dto.getClient();
        if (predefClients != null) {
            dto.setName(predefClients.getName().getTitle().trim());
            dto.setSurname(predefClients.getSurname().getTitle().trim());
            dto.setPatron(predefClients.getPatronymic() == null ? "" : predefClients.getPatronymic().getTitle().trim());
        }

        boolean canWork = false;
        DetachedCriteria queryCriteria = DetachedCriteria.forClass(Client.class).setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY);
        //ФИО
View Full Code Here

        List<SheduleReception> receptions = getDao().getList(queryCriteria, null, 51);
        model.put("count", receptions.size() > 50);

        HashMap<Integer, ReceptionGroup> map = new HashMap<Integer, ReceptionGroup>();
        for (SheduleReception reception : receptions) {
            Client client = reception.getClient();
            Address address = null;
            if (client.getAddressID() != null) {
                address = getDao().getById(Address.class, client.getAddressID());
            }
            ReceptionGroup group = map.get(client.getId());
            if (group == null) {
                group = new ReceptionGroup();
                lines.add(group);
                map.put(client.getId(), group);
                group.client = client;
                group.addressClient = address != null ? address.getAsStringShort() : "";
                group.receptionLines = new ArrayList<ReceptionLine>();
            }
View Full Code Here


    @Override
    protected Object formBackingObject(HttpServletRequest request) throws Exception {
        ClientDTO clientDTO = new ClientDTO();
        Client client = null;

        try {
            client = CH.getOptional(getDao(), Client.class, request.getParameter("client"));
        } catch (Exception ex) {
        }
       
        boolean editbypacient = Boolean.parseBoolean(request.getParameter("editbypacient"));
        clientDTO.setClient(client);
        clientDTO.setEditbypacient(editbypacient);
        if (client != null) {
            Address address = getDao().getById(Address.class, client.getAddressID());
            AddressObject ao = address.getAddressObject();
            if (ao.getType().getLevel() == 6){
                ao = ao.getParent();
            }

            Date born = client.getBorn();
            GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance();
            cal.setTime(born);
            clientDTO.setBornDay(cal.get(Calendar.DAY_OF_MONTH));
            clientDTO.setBornMonth(cal.get(Calendar.MONTH));
            clientDTO.setBornYear(Integer.toString(cal.get(Calendar.YEAR)));
            clientDTO.setSurname(client.getSurname() == null ? "" : client.getSurname().getTitle());
            clientDTO.setName(client.getName() == null ? "" : client.getName().getTitle());
            clientDTO.setPatronymic(client.getPatronymic() == null ? "" : client.getPatronymic().getTitle());
            clientDTO.setPhoneNumber(client.getTelephones());
            clientDTO.setSex(client.getSex());

            clientDTO.setStreet(ao);
            ao = ao.getParent();
            if (ao.getType().getLevel() == 4){
                clientDTO.setVillage(ao);
                ao = ao.getParent();
            }
            clientDTO.setCity(ao);
            ao = ao.getParent();
            clientDTO.setArea(ao);
            ao = ao.getParent();

            if (client.getDistrict() != null) {
                clientDTO.setDistrict(client.getDistrict());
            }
            clientDTO.setBuilding(address.getBuilding());
            clientDTO.setFlat(address.getFlat());
        }
        return clientDTO;
View Full Code Here

            errors.rejectValue("phoneNumber", "register.wrongphone");
            return showForm(request, errors, getFormView());
        }
        //end checkDTO

        Client client = clientDTO.getClient();
        if (client == null) {
            client = new Client();
            try {
                Address address = createAddress(clientDTO);
                client.setAddressID(address.getId());
                client.setAddressCashe(address.getAsStringCashe());
            } catch (Exception ex) {
                errors.rejectValue("area", "register.wrongaddress");
                return showForm(request, errors, getFormView());
            }
        }else{
            Address address = getDao().getById(Address.class, client.getAddressID());
            address.setAddressObject(clientDTO.getStreet());
            address.setBuilding(clientDTO.getBuilding());
            address.setFlat(clientDTO.getFlat());
            try {
                AddressManager.correctAddress(getDao(), address);
            } catch (Exception ex) {
                errors.rejectValue("area", "register.wrongaddress");
                return showForm(request, errors, getFormView());
            }
            getDao().save(address);
            client.setAddressCashe(address.getAsStringCashe());
        }
        client.setBorn(getBornDate(clientDTO));
        //STUB
        //client.setAddress(null);
        //client.setDistrict(null);
        //client.setOms(urdto.getOms());
        //END STUB
        client.setName(getDirectoryItem(Name.class, clientDTO.getName()));
        client.setPatronymic(getDirectoryItem(Patronymic.class, clientDTO.getPatronymic()));
        client.setTelephones(clientDTO.getPhoneNumber());
        client.setSex(clientDTO.getSex());
        client.setSurname(getDirectoryItem(Surname.class, clientDTO.getSurname()));
        getDao().save(client);
        return new ModelAndView("redirect:selectclient.htm");
    }
View Full Code Here

        binder.registerCustomEditor(Collaborator.class, new Editor(getDao(), Collaborator.class));
    }

    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        Client client = CH.getOptional(getDao(), Client.class, request.getParameter("client"));
        Collaborator collab = CH.getOptional(getDao(), Collaborator.class, request.getParameter("collaborator"));
        WorkType type = CH.getOptional(getDao(), WorkType.class, request.getParameter("type"));
        Lpu lpu = CH.getOptional(getDao(), Lpu.class, request.getParameter("lpu"));
        if (collab == null) {
            return IncomingParamsValidator.redirectTo("/operator/collaborator.htm", client, type, lpu, collab);
View Full Code Here

TOP

Related Classes of domain.Client

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.