private FileStatus ProcessPinFile_SmartVista(issuer config) { //branchCode = batchReference.Substring(0, batchReference.IndexOf('_')); //read file //IndigoFileLoader.objects.root.ACardsFile cardsFile = null; var cardsFile = new CSVFile(fullFileName, false, false); List <string[]> records = cardsFile.ReadFile(); //note --- check if ref is null //parse records, format contents for (int i = 0; i < records.Count; i++) { var newRecord = new string[3]; string record = records[i][0]; newRecord[0] = record.Substring(0, 4) + record.Substring(5, 4) + record.Substring(10, 4) + record.Substring(15, 4); newRecord[1] = IndigoFileLoader.utility.UtilityClass.HandleUnexpectedCharacters( record.Substring(record.IndexOf('^') + 1, record.LastIndexOf('^') - record.IndexOf('^') - 1) .Replace('/', ' ')); newRecord[2] = record.Substring(record.LastIndexOf('#') + 1, 16); records[i] = newRecord; } return(FileStatus.READ); }
private static void ReadCustomerFile(string[] args) { var filename = CSVFile.FindFile(args[0]); Console.WriteLine("Fetching bank consent for customers in {0}", filename); customers = new List <Customer>(CSVFile.ReadFile(filename)); }
public Service(string bankId, string URL = null) { this.bankId = bankId; var data = from c in CSVFile.ReadFile(CSVFile.FindFile("testdata.csv")) where c.BankId == bankId select new BankCustomer { Id = c.CustomerId, Consent = c.ConsentBank, PostCode = c.PostCode, City = c.City }; customers = new List <BankCustomer>(data); if (URL != null) { Uri baseAddress = new Uri(URL); host = new WebServiceHost(this, baseAddress); host.Open(); } }
public void LoadTestDataTest() { var data = new List <Customer>(CSVFile.ReadFile(CSVFile.FindFile("testdata.csv"))); Assert.AreEqual(49, data.Count()); }