Smsgw.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using Oracle.ManagedDataAccess.Client;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. namespace ReportWeb.Models
  7. {
  8. public class WebserviceObj
  9. {
  10. public WebserviceObj()
  11. {
  12. }
  13. public int ws_id { get; set; }
  14. public String ws_name { get; set; }
  15. public String ws_code { get; set; }
  16. public String wsdl { get; set; }
  17. public String msg_template { get; set; }
  18. public int status { get; set; }
  19. public static List<WebserviceObj> Parse(OracleDataReader reader)
  20. {
  21. List<WebserviceObj> result = new List<WebserviceObj>();
  22. try
  23. {
  24. while (reader.Read())
  25. {
  26. WebserviceObj sv = new WebserviceObj();
  27. for (int i = 0; i < reader.FieldCount; i++)
  28. {
  29. if (reader.GetName(i).ToUpper() == "WS_ID")
  30. try
  31. {
  32. sv.ws_id = int.Parse(reader.GetValue(i).ToString());
  33. }
  34. catch { }
  35. else if (reader.GetName(i).ToUpper() == "WS_NAME")
  36. try
  37. {
  38. sv.ws_name = reader.GetValue(i).ToString();
  39. }
  40. catch { }
  41. else if (reader.GetName(i).ToUpper() == "WS_CODE")
  42. try
  43. {
  44. sv.ws_code = reader.GetValue(i).ToString();
  45. }
  46. catch { }
  47. else if (reader.GetName(i).ToUpper() == "WSDL")
  48. try
  49. {
  50. sv.wsdl = reader.GetValue(i).ToString();
  51. }
  52. catch { }
  53. else if (reader.GetName(i).ToUpper() == "MSG_TEMPLATE")
  54. try
  55. {
  56. sv.msg_template = reader.GetValue(i).ToString();
  57. }
  58. catch { }
  59. else if (reader.GetName(i).ToUpper() == "STATUS")
  60. try
  61. {
  62. sv.status = int.Parse(reader.GetValue(i).ToString());
  63. }
  64. catch { }
  65. }
  66. result.Add(sv);
  67. }
  68. reader.Close();
  69. }
  70. catch
  71. {
  72. }
  73. finally
  74. {
  75. try
  76. {
  77. reader.Close();
  78. }
  79. catch { }
  80. }
  81. return result;
  82. }
  83. }
  84. }