Example #1
0
        public int ConsultarTotalSINAC(Collection <string> colAnosNac, Collection <string> colMeses, Collection <Municipio> colMunicipios)
        {
            try
            {
                IList <string> anosNacLista = new List <string>(colAnosNac);
                string         anosNacUnion = string.Join(",", anosNacLista);

                IList <string> mesesLista = new List <string>(colMeses);
                string         mesesUnion = string.Join(",", mesesLista);

                IList <string> municipiosLista = new List <string>();
                foreach (Municipio m in colMunicipios)
                {
                    municipiosLista.Add(m.MpioId.ToString());
                }
                string municipiosUnion = string.Join(",", municipiosLista);

                return(reporteDAO.ConsultarTotalSINAC(anosNacUnion, mesesUnion, municipiosUnion));
            }
            catch (DAOException e)
            {
                Bitacora.Error(e.Message);
                if (e.Codigo == 1)
                {
                    throw new BusinessException(e.Message);
                }
                else
                {
                    throw new BusinessException("No se completó la consulta del reporte, favor de intentar nuevamente: " + e.Message);
                }
            }
        }