/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package demojsoncrud.services;

import demojsoncrud.beans.UbigeoBean;
import demojsoncrud.dao.DAOFactory;
import demojsoncrud.dao.UbigeoDAO;
import org.json.JSONObject;

/**
 *
 * @author Alonso
 */
public class UbigeoService {

    DAOFactory daoFactory = DAOFactory.getDAOFactory(DAOFactory.SQL_SERVER);
    UbigeoDAO service = daoFactory.getUbigeoDAO();

    public JSONObject listarDepartamento() {
        JSONObject jsonReturn = null;
        try {
            jsonReturn = service.listarDepartamento();
        } catch (Exception e) {
        }
        return jsonReturn;
    }

    public JSONObject listarProvincia(UbigeoBean bean) {
        JSONObject jsonReturn = null;
        try {
            jsonReturn = service.listarProvincia(bean);
        } catch (Exception e) {
        }
        return jsonReturn;
    }

    public JSONObject listarDistrito(UbigeoBean bean) {
        JSONObject jsonReturn = null;
        try {
            jsonReturn = service.listarDistrito(bean);
        } catch (Exception e) {
        }
        return jsonReturn;
    }

}
