Package clips.delegate.client

Source Code of clips.delegate.client.ClientSearchLocal

/*
* ClientSearchLocal.java
*
* Created on 28 Ноябрь 2007 г., 13:42
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package clips.delegate.client;

import beans.user.search.ClientSearchBeanRemote;
import beans.user.search.ClientFilter;
import beans.user.search.ClientSearchBean;
import cli_fmw.delegate.DelegateSimple;
import cli_fmw.main.ClipsException;
import beans.user.client.entity.ClientDetails;
import beans.user.search.ClientListChunk;
import cli_fmw.delegate.AuditListener;
import framework.beans.ModificationInfo;
import framework.generic.ClipsServerException;
import java.util.ArrayList;
import java.util.List;

/**
* Делегат, выполняющий поиск клиентов.
* @author Администратор
*/
public class ClientSearchLocal extends DelegateSimple<ClientSearchBeanRemote> {
    private int listSize = 0;
    private ArrayList<ClientLocal> clientList = new ArrayList<ClientLocal>();

    public ClientSearchLocal(AuditListener al) throws ClipsException {
        super(ClientSearchBean.class.getSimpleName());
        initBean();
        this.am = al;
    }
   
    public ArrayList<ClientLocal> getClientList(ClientFilter filter) throws ClipsException {
        try {
            clientList = new ArrayList<ClientLocal>();
           
            ClientListChunk chunk = bean().getList(filter);
            listSize = chunk.listSize;
            List<ClientDetails> res = chunk.clientList;
            for (ClientDetails d : res) {
                ClientLocal client = new ClientLocal(d, am);
                clientList.add(client);
            }
            return clientList;
        } catch (Exception ex) {
            clearBean();
            throw new ClipsException("Не удалось загрузить список пациентов", ex);
        }
    }

    public int getListSize() {
        return listSize;
    }

    public ModificationInfo unionPacients() throws ClipsException {
        try {
            return bean().unionPacients();
        } catch (ClipsServerException ex) {
            throw new ClipsException("Ошибка при объединении пациентов", ex);
        }
    }
}
TOP

Related Classes of clips.delegate.client.ClientSearchLocal

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.