public static AuxCsv GetFronCsv(string csvLine) { try { string[] values = csvLine.Split(';'); if (values.Count() == 6) { AuxCsv aux = new AuxCsv { Rut = values[0], Name = values[1], Email = values[4] }; return(aux); } else { AuxCsv aux = new AuxCsv { Rut = "0", Name = "0", Email = "0" }; return(aux); } } catch (Exception) { throw; } }
public static AuxCsv GetAuxCvsFromFile(Detalle detalle) { AuxCsv auxCsv = new AuxCsv(); try { auxCsv = AuxCsvsList.FirstOrDefault(x => x.Rut == detalle.Instruction.ParticipantDebtor.Rut + "-" + detalle.Instruction.ParticipantDebtor.VerificationCode); return(auxCsv); } catch (Exception) { return(null); } }
public static void ReadFileSii() { AuxCsvsList = File.ReadAllLines(Path).Skip(1).Select(v => AuxCsv.GetFronCsv(v)).ToList(); }