You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.4 KiB

1 year ago
  1. using Dapper;
  2. using Microsoft.Data.SqlClient;
  3. using Npgsql;
  4. using Oracle.ManagedDataAccess.Client;
  5. using Shentun.Utilities;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Data.Common;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace Shentun.WebPeis.PlugIns.ColumnReferences
  13. {
  14. public class ColumnReferencePlugInsDbBase : ColumnReferencePlugInsBase
  15. {
  16. public ColumnReferencePlugInsDbBase(string parmValue) : base(parmValue)
  17. {
  18. InterfaceSql = InterfaceConfig.GetSection("Interface").GetSection("Sql").Value;
  19. InterfaceDbType = InterfaceConfig.GetSection("Interface").GetSection("DbType").Value;
  20. InterfaceConnctionStr = InterfaceConfig.GetSection("Interface").GetSection("ConnectionStrings").Value;
  21. }
  22. public override async Task<List<ColumnReferenceCodeValue>> GetInterfaceCodeValuesAsync()
  23. {
  24. using (DbConnection conn = CreateInterfaceDbConnect())
  25. {
  26. var list = (await conn.QueryAsync<ColumnReferenceCodeValue>(InterfaceSql)).ToList();
  27. foreach (var item in list)
  28. {
  29. if(string.IsNullOrWhiteSpace(item.SimpleCode))
  30. {
  31. item.SimpleCode = LanguageConverter.GetPYSimpleCode(item.DisplayName);
  32. }
  33. }
  34. return list;
  35. }
  36. }
  37. }
  38. }