using Oracle.ManagedDataAccess.Client; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace ReportWeb.Models { public class WebserviceObj { public WebserviceObj() { } public int ws_id { get; set; } public String ws_name { get; set; } public String ws_code { get; set; } public String wsdl { get; set; } public String msg_template { get; set; } public int status { get; set; } public static List Parse(OracleDataReader reader) { List result = new List(); try { while (reader.Read()) { WebserviceObj sv = new WebserviceObj(); for (int i = 0; i < reader.FieldCount; i++) { if (reader.GetName(i).ToUpper() == "WS_ID") try { sv.ws_id = int.Parse(reader.GetValue(i).ToString()); } catch { } else if (reader.GetName(i).ToUpper() == "WS_NAME") try { sv.ws_name = reader.GetValue(i).ToString(); } catch { } else if (reader.GetName(i).ToUpper() == "WS_CODE") try { sv.ws_code = reader.GetValue(i).ToString(); } catch { } else if (reader.GetName(i).ToUpper() == "WSDL") try { sv.wsdl = reader.GetValue(i).ToString(); } catch { } else if (reader.GetName(i).ToUpper() == "MSG_TEMPLATE") try { sv.msg_template = reader.GetValue(i).ToString(); } catch { } else if (reader.GetName(i).ToUpper() == "STATUS") try { sv.status = int.Parse(reader.GetValue(i).ToString()); } catch { } } result.Add(sv); } reader.Close(); } catch { } finally { try { reader.Close(); } catch { } } return result; } } }