public async Task <List <DBFMail> > GetEmail(string path, string ID, bool direction) { List <DBFMail> emails = new List <DBFMail>(); using (var table = await Table.OpenAsync(path + "EMAILFOX.DBF")) { var reader = table.OpenReader(Encoding.ASCII); while (reader.Read()) { var row = new DBFMail() { ID = reader.GetString("ID"), CONTENT = reader.GetString("CONTENT"), EXP_ID = reader.GetString("EXP_ID"), DEST_ID = reader.GetString("DEST_ID"), READ = reader.GetDecimal("READ") }; if (direction) { if (row.EXP_ID == ID) { emails.Add(row); } } else { if (row.DEST_ID == ID) { emails.Add(row); } } } } return(emails); }
public async Task <List <DBFMail> > OpenDBF(string path) { List <DBFMail> emails = new List <DBFMail>(); using (var table = await Table.OpenAsync(path + "EMAILFOX.DBF")) { var reader = table.OpenReader(Encoding.ASCII); while (reader.Read()) { var row = new DBFMail() { ID = reader.GetString("ID"), CONTENT = reader.GetString("CONTENT"), EXP_ID = reader.GetString("EXP_ID"), DEST_ID = reader.GetString("DEST_ID"), READ = reader.GetDecimal("READ") }; emails.Add(row); } } return(emails); }