예제 #1
0
        private static SdtPershingPDF ParsearUnaPaginaTxtPershing(string[] paginas, int pageNumber)
        {
            string[]               todasLasLineas  = paginas[pageNumber].Split('\n');
            int                    lineaEspecifica = 6; //Las primeras 6 filas son encabezado, no datos (son el nombre del banco y de las columnas)
            SdtPershingPDF         retorno         = new SdtPershingPDF();
            List <PershingInteres> intereses       = new List <PershingInteres>();
            PershingInteres        interesParseado;
            bool                   termine = false;

            while (lineaEspecifica < todasLasLineas.Length - 1 && !termine)
            {
                if (!EsLineaEnBlanco(todasLasLineas[lineaEspecifica]))
                {
                    if (EsInteres(todasLasLineas, lineaEspecifica))
                    {
                        interesParseado = ParsearUnInteresPershing(todasLasLineas, ref lineaEspecifica);
                        intereses.Add(interesParseado);
                        //lineaEspecifica += 2; lo cambio, esto es variable, por tanto lo maneja/incrementa el
                        //parser de intereses, que tiene acceso directo a los datos
                    }
                    else // si no es un interes, entonces es un "total final verificador"
                    {
                        retorno.all = ProcesarTodosLosTotalesFinales(todasLasLineas, ref lineaEspecifica);
                        termine     = true;
                    }
                }
                else
                {
                    lineaEspecifica += 1;
                }
            }
            retorno.intereses = intereses;
            return(retorno);
        }
예제 #2
0
        private static SdtPershingPDF ProcesarTxtPagesPershing(string[] paginas)
        {
            SdtPershingPDF retorno = new SdtPershingPDF();

            for (int page = 1; page <= paginas.Length - 1; page++)
            {
                retorno = ParsearUnaPaginaTxtPershing(paginas, page);
            }
            return(retorno);
        }