Package ru.portnyagin.helpdeskru.model

Examples of ru.portnyagin.helpdeskru.model.HistoryRequest


    public Object getAsObject(FacesContext context, UIComponent component, String value) {
        if (value == null || value.length() == 0){
            return null;
        }

        HistoryRequest history = historyRequestService.find(Long.valueOf(value));

        if (history == null) {
            throw new ConverterException(new FacesMessage("Unknown HistoryRequest ID: " + value));
        }
View Full Code Here


            }
           
            // состояние
            if(!current.getStateRequest().equals(preUpdate.getStateRequest())) {
                current.setStateDate(new Date()); // при изменении состояния обновляем дату состояния
                HistoryRequest h = new HistoryRequest(current, curUser, new Date(),
                        ResourceBundle.getBundle("property",
                        FacesContext.getCurrentInstance().getViewRoot().getLocale()).
                        getString("common.stateRequest"),
                        current.getStateRequest().getName());
                em.persist(h);
            }

            // исполнитель. м.б. null
            String curPerformer;
            String prevPerformer;
            if(current.getPerformer() != null) {
                curPerformer = current.getPerformer().getName();
            }
            else {
                curPerformer = "";
            }
           
            if(preUpdate.getPerformer() != null) {
                prevPerformer = preUpdate.getPerformer().getName();
            }
            else {
                prevPerformer = "";
            }
           
            if(!curPerformer.equals(prevPerformer)) {
                    HistoryRequest h = new HistoryRequest(current, curUser, new Date(),
                        ResourceBundle.getBundle("property",
                        FacesContext.getCurrentInstance().getViewRoot().getLocale()).
                        getString("common.performer"),
                        curPerformer);
                    em.persist(h);
            }

            // объект обслуживания. м.б. null
            String curServiceObject;
            String prevServiceObject;
            if(current.getServiceObject() != null) {
                curServiceObject = current.getServiceObject().getName();
            }
            else {
                curServiceObject = "";
            }
           
            if(preUpdate.getServiceObject() != null) {
                prevServiceObject = preUpdate.getServiceObject().getName();
            }
            else {
                prevServiceObject = "";
            }
           
            if(!curServiceObject.equals(prevServiceObject)) {
                    HistoryRequest h = new HistoryRequest(current, curUser, new Date(),
                        ResourceBundle.getBundle("property",
                        FacesContext.getCurrentInstance().getViewRoot().getLocale()).
                        getString("common.serviceObject"),
                        curServiceObject);
                    em.persist(h);
            }
           
            // описание м.б. null
            String curDescription;
            String prevDescription;
            if(current.getDescription() != null) {
                curDescription = current.getDescription();
            }
            else {
                curDescription = "";
            }
           
            if(preUpdate.getDescription() != null) {
                prevDescription = preUpdate.getDescription();
            }
            else {
                prevDescription = "";
            }
           
            if(!curDescription.equals(prevDescription)) {
                    HistoryRequest h = new HistoryRequest(current, curUser, new Date(),
                        ResourceBundle.getBundle("property",
                        FacesContext.getCurrentInstance().getViewRoot().getLocale()).
                        getString("common.description"),
                        curDescription);
                    em.persist(h);
            }
           
            // приоритет
            if(!current.getPriority().equals(preUpdate.getPriority())) {
                HistoryRequest h = new HistoryRequest(current, curUser, new Date(),
                        ResourceBundle.getBundle("property",
                        FacesContext.getCurrentInstance().getViewRoot().getLocale()).
                        getString("common.priority"),
                        current.getPriority().getName());
                em.persist(h);
View Full Code Here

TOP

Related Classes of ru.portnyagin.helpdeskru.model.HistoryRequest

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.