| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
-
- using System;
- using System.Collections.Generic;
- using Oracle.ManagedDataAccess.Client;
- using System.Linq;
- using System.Web;
- namespace ReportWeb.Models
- {
- public class ChargeLog
- {
- public ChargeLog()
- {
- //
- // TODO: Add constructor logic here
- //
- }
- public string description { get; set; }
- public string msisdn { get; set; }
- public long fee { get; set; }
- public DateTime? chargeTime { get; set; }
- public DateTime? fromDate { get; set; }
- public DateTime? toDate { get; set; }
- public string service { get; set; }
- public long count_reg { get; set; }
- public long count_active { get; set; }
- public long count_destroy { get; set; }
- public string channel { get; set; }
- public string product_name { get; set; }
- public static List<ChargeLog> Parse(OracleDataReader reader)
- {
- List<ChargeLog> result = new List<ChargeLog>();
- try
- {
- while (reader.Read())
- {
- ChargeLog chargeLog = new ChargeLog();
- for (int i = 0; i < reader.FieldCount; i++)
- {
- if (reader.GetName(i).ToUpper() == "DESCRIPTION")
- {
- try
- {
- chargeLog.description = reader.GetValue(i).ToString();
- }
- catch { }
- }
- else if (reader.GetName(i).ToUpper() == "MSISDN")
- {
- try
- {
- chargeLog.msisdn = reader.GetValue(i).ToString();
- }
- catch { }
- }
- else if (reader.GetName(i).ToUpper() == "CHARGE_TIME")
- try
- {
- chargeLog.chargeTime = reader.GetDateTime(i);
- }
- catch { }
- else if (reader.GetName(i).ToUpper() == "FEE")
- try
- {
- chargeLog.fee = long.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- else if (reader.GetName(i).ToUpper() == "COUNT_REG")
- try
- {
- chargeLog.count_reg = long.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- else if (reader.GetName(i).ToUpper() == "COUNT_DESTROY")
- try
- {
- chargeLog.count_destroy = long.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- else if (reader.GetName(i).ToUpper() == "COUNT_ACTIVE")
- try
- {
- chargeLog.count_active = long.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- else if (reader.GetName(i).ToUpper() == "CHANNEL")
- {
- try
- {
- chargeLog.channel = reader.GetValue(i).ToString();
- }
- catch { }
- }
- else if (reader.GetName(i).ToUpper() == "PRODUCT_NAME")
- {
- try
- {
- chargeLog.product_name = reader.GetValue(i).ToString();
- }
- catch { }
- }
- }
- result.Add(chargeLog);
- }
- reader.Close();
- }
- catch
- {
- }
- finally
- {
- try
- {
- reader.Close();
- }
- catch { }
- }
- return result;
- }
- }
- }
|