I have the following Enum that reads a text file accordingly. What I need to do with the file is parse the date from the textfile name so I can check records for it through my database. How do I set the each file to read through the date?
What I have tried:
public enum FileType
{
Customer, Account, Transaction
}
public FileTypeInfo(FileType type, int ssnesPos, int idPos, string name)
: this()
{
Type = type;
SSNesPosition = ssnesPos;
CustIDPosition = idPos;
Name = name;
}
FileInfo = new Dictionary<FileType, FileTypeInfo>();
FileInfo[FileType.Customer] = new FileTypeInfo(FileType.Customer, 3, -1, "Customers");
FileInfo[FileType.Account] = new FileTypeInfo(FileType.Account, -1, 1, "Accounts");
FileInfo[FileType.Transaction] = new FileTypeInfo(FileType.Transaction, -1, 1, "Transactions");
string names = "";
foreach (var f in FileInfo)
{
names += f.Value.Name + ", ";
}
names = names.Remove(names.Length - 2);
Log.Info("Found configuration information for " + FileInfo.Count + " types of file: " + names + ".");
}