| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using Oracle.ManagedDataAccess.Client;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace ReportWeb.Models
- {
- public class ScenarioPlayObj
- {
- // scenario play
- public int id { get; set; }
- public int service_id { get; set; }
- public string hour_active { get; set; }
- public string date_active { get; set; }
- public string msisdn { get; set; }
- public double money_left { get; set; }
- public string status { get; set; }
- public int turn_left { get; set; }
- public int buying_time { get; set; }
- public static List<ScenarioPlayObj> Parse(OracleDataReader reader)
- {
- List<ScenarioPlayObj> result = new List<ScenarioPlayObj>();
- List<int> listId = new List<int>();
- try
- {
- while (reader.Read())
- {
- ScenarioPlayObj sv = new ScenarioPlayObj();
- SvAdv adv = new SvAdv();
- for (int i = 0; i < reader.FieldCount; i++)
- {
- if (reader.GetName(i).ToLower() == "id")
- try
- {
- sv.id = int.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- else if (reader.GetName(i).ToLower() == "service_id")
- try
- {
- sv.service_id = int.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- else if (reader.GetName(i).ToLower() == "hour_active")
- try
- {
- sv.hour_active = reader.GetValue(i).ToString();
- }
- catch { }
- else if (reader.GetName(i).ToLower() == "date_active")
- try
- {
- sv.date_active = reader.GetValue(i).ToString(); ;
- }
- catch { }
- else if (reader.GetName(i).ToLower() == "msisdn")
- try
- {
- sv.msisdn = reader.GetValue(i).ToString(); ;
- }
- catch { }
- else if (reader.GetName(i).ToLower() == "money_left")
- try
- {
- sv.money_left = double.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- else if (reader.GetName(i).ToLower() == "status")
- try
- {
- sv.status = reader.GetValue(i).ToString(); ;
- }
- catch { }
- else if (reader.GetName(i).ToLower() == "turn_left")
- try
- {
- sv.turn_left = int.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- else if (reader.GetName(i).ToLower() == "buying_time")
- try
- {
- sv.buying_time = int.Parse(reader.GetValue(i).ToString());
- }
- catch { }
- }
-
- result.Add(sv);
- }
- reader.Close();
- }
- catch
- {
- }
- finally
- {
- try
- {
- reader.Close();
- }
- catch { }
- }
- return result;
- }
- }
- }
|