Created ECN# autocomplete for PCR3 docs
This commit is contained in:
@ -4,6 +4,7 @@ namespace MesaFabApproval.API.Services;
|
||||
|
||||
public interface IECNService {
|
||||
Task<bool> IsValidECNNumber(int number);
|
||||
Task<IEnumerable<int>> GetAllECNNumbers();
|
||||
}
|
||||
|
||||
public class ECNService : IECNService {
|
||||
@ -43,4 +44,19 @@ public class ECNService : IECNService {
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<int>> GetAllECNNumbers() {
|
||||
try {
|
||||
_logger.LogInformation("Attempting to get all ECN#s");
|
||||
|
||||
string sql = "select ECNNumber from ECN where Deleted=0 and Cancelled=0";
|
||||
|
||||
IEnumerable<int> allEcnNumbers = await _dalService.QueryAsync<int>(sql);
|
||||
|
||||
return allEcnNumbers;
|
||||
} catch (Exception ex) {
|
||||
_logger.LogError($"Unable to get all ECN#s, because {ex.Message}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user