| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
-
- using System;
- using System.Collections.Generic;
- using Oracle.ManagedDataAccess.Client;
- using System.Linq;
- using System.Web;
- namespace ReportWeb.Models
- {
- public class SpinLog
- {
- public SpinLog()
- { }
- public string msisdn { get; set; }
- public DateTime? insert_time { get; set; }
- public DateTime? expire_time { get; set; }
- public DateTime? last_update { get; set; }
- public int added { get; set; }
- public int used { get; set; }
- public string channel_add { get; set; }
- public static List<SpinLog> Parse(OracleDataReader reader)
- {
- List<SpinLog> result = new List<SpinLog>();
- try
- {
- while (reader.Read())
- {
- SpinLog spinLog = new SpinLog();
- for (int i = 0; i < reader.FieldCount; i++)
- {
- if (reader.GetName(i).ToUpper() == "MSISDN")
- {
- try
- {
- spinLog.msisdn = reader.GetValue(i).ToString();
- }
- catch { }
- }
- else if (reader.GetName(i).ToUpper() == "INSERT_TIME")
- try
- {
- spinLog.insert_time = reader.GetDateTime(i);
- }
- catch { }
- else if (reader.GetName(i).ToUpper() == "EXPIRE_TIME")
- try
- {
- spinLog.expire_time = reader.GetDateTime(i);
- }
- catch { }
- else if (reader.GetName(i).ToUpper() == "LAST_UPDATE")
- try
- {
- spinLog.last_update = reader.GetDateTime(i);
- }
- catch { }
- else if (reader.GetName(i).ToUpper() == "ADDED")
- {
- try
- {
- spinLog.added = int.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- }
- else if (reader.GetName(i).ToUpper() == "USED")
- {
- try
- {
- spinLog.used = int.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- }
- else if (reader.GetName(i).ToUpper() == "CHANNEL_ADD")
- {
- try
- {
- spinLog.channel_add = reader.GetValue(i).ToString();
- }
- catch { }
- }
- }
- result.Add(spinLog);
- }
- reader.Close();
- }
- catch
- {
- }
- finally
- {
- try
- {
- reader.Close();
- }
- catch { }
- }
- return result;
- }
- }
- }
|