optimize the background jobs
This commit is contained in:
@@ -94,6 +94,29 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
return applications.ToArray();
|
||||
}
|
||||
|
||||
public async Task<string[]> GetApplicationResponseEmailFromJobListing(int JobListingID) {
|
||||
List<string> emailadds = new List<string>();
|
||||
using (MySqlConnection connection = GetConnection()) {
|
||||
await connection.OpenAsync();
|
||||
string command = @"
|
||||
SELECT ResponseEmail
|
||||
FROM JobApplication
|
||||
WHERE JobListingID = @JobListingID
|
||||
";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(command, connection);
|
||||
cmd.Parameters.AddWithValue("@JobListingID", JobListingID);
|
||||
|
||||
using (DbDataReader reader = await cmd.ExecuteReaderAsync()) {
|
||||
while (await reader.ReadAsync()) {
|
||||
string _responseemail = reader.GetString("ResponseEmail");
|
||||
emailadds.Add(_responseemail);
|
||||
}
|
||||
}
|
||||
}
|
||||
return emailadds.ToArray();
|
||||
}
|
||||
|
||||
public async Task<Application?> GetApplication(int ApplicationID) {
|
||||
Application? application = null;
|
||||
using (MySqlConnection connection = GetConnection()) {
|
||||
|
||||
Reference in New Issue
Block a user