public void Parse() { using (var reader = new StreamReader(docPath, Encoding.GetEncoding(1251))) { string line; var count = 0; var paymentByCardFrom = PaymentByCardOnlineFrom.FromVodovozWebSite; while ((line = reader.ReadLine()) != null) { count++; if (line == string.Empty) { continue; } if (count == 1) { var paymentFrom = line.Split(new [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); TryMatchPaymentFrom(paymentFrom[3].Trim('.'), ref paymentByCardFrom); } var data = line.Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries); if (Guid.TryParse(data[0], out Guid result)) { var payment = new PaymentByCardOnline(data, paymentByCardFrom); PaymentsFromYookassa.Add(payment); } } } }
public void Parse() { using (var reader = new StreamReader(docPath, Encoding.GetEncoding(1251))) { string line; while ((line = reader.ReadLine()) != null) { if (line == string.Empty) { continue; } var data = line.Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries); if (Guid.TryParse(data[0], out Guid result)) { var payment = new PaymentByCardOnline(data, false); PaymentsFromYookassa.Add(payment); } } } }