public void Importar(string strFileName) { DALTDummy dAL = new DALTDummy(); int counter = 0; string line; System.IO.StreamReader file = new System.IO.StreamReader(strFileName); List <TDummy> lst = new List <TDummy>(); while ((line = file.ReadLine()) != null) { TDummy seq = Extrair(line); if (seq.um != "") { try { lst.Add(seq); } catch (Exception ex) { throw ex; } }
public void ImportarGenerico(string strFileName) { BLLGuia bLLG = new BLLGuia(); BLLProcesso bLLP = new BLLProcesso(); DALTDummy dAL = new DALTDummy(); int counter = 0; string line; System.IO.StreamReader file = new System.IO.StreamReader(strFileName); List <TDummy> lst = new List <TDummy>(); List <Guia> lstGuia = new List <Guia>(); List <Processo> lstProcesso = new List <Processo>(); while ((line = file.ReadLine()) != null) { TDummy seq = Extrair(line); counter++; lst.Add(seq); if (!lstGuia.Exists(x => x.NumeroGuia == seq.dois)) { lstGuia.Add(bLLG.Extrair(line)); } if (bLLP.VerificarProcesso(seq)) { lstProcesso.Add(bLLP.Extrair(line)); } } try { // dAL.AdicionarRange(lst); bLLG.AdicionarRange(lstGuia); bLLP.AdicionarRange(lstProcesso); } catch (Exception ex) { throw ex; } }