コード例 #1
0
        public List <Record> GetAll()
        {
            List <Record> listRecord = new List <Record>();

            string sql = "SELECT R.ID, R.DISK, R.SEQ, R.STATUS, R.ON_AIR_DATE, R.PROGRAM_ID, R.DURATION, R.DETAIL, R.CREATE_DATE, R.UPDATE_DATE, P.NAME "
                         + "FROM RECORD R "
                         + "  LEFT JOIN PROGRAM P "
                         + "    ON R.PROGRAM_ID = P.CHANNEL_ID ";

            dbcon.openConnection();

            SqlCommand command = new SqlCommand();

            command = new SqlCommand(sql, dbcon.getSqlConnection());

            SqlDataReader reader = dbcon.GetExecuteReader(sql);

            if (reader.IsClosed)
            {
                throw new Exception("arrear.TargetAccountDataの取得でreaderがクローズされています");
            }

            while (reader.Read())
            {
                Record data = new Record();

                data.Id          = DbExportCommon.GetDbInt(reader, 0);
                data.Disk        = DbExportCommon.GetDbString(reader, 1);
                data.Seq         = DbExportCommon.GetDbString(reader, 2);
                data.RipStatus   = DbExportCommon.GetDbString(reader, 3);
                data.OnAirDate   = DbExportCommon.GetDbDateTime(reader, 4);
                data.ProgramId   = DbExportCommon.GetDbString(reader, 5);
                data.Duration    = DbExportCommon.GetDbString(reader, 6);
                data.Detail      = DbExportCommon.GetDbString(reader, 7);
                data.CreateDate  = DbExportCommon.GetDbDateTime(reader, 8);
                data.UpdateDate  = DbExportCommon.GetDbDateTime(reader, 9);
                data.ProgramName = DbExportCommon.GetDbString(reader, 10);

                listRecord.Add(data);
            }

            return(listRecord);
        }
コード例 #2
0
        public List <Program> GetAll()
        {
            List <Program> listProgram = new List <Program>();

            string sql = "SELECT CHANNEL_ID, NAME, ABBREVIATION_NAME, RELATION_ID, ON_AIR_START, ON_AIR_END, DETAIL, REMARK, CREATE_DATE, UPDATE_DATE "
                         + " FROM PROGRAM ";

            dbcon.openConnection();

            SqlCommand command = new SqlCommand();

            command = new SqlCommand(sql, dbcon.getSqlConnection());

            SqlDataReader reader = dbcon.GetExecuteReader(sql);

            if (reader.IsClosed)
            {
                throw new Exception("arrear.TargetAccountDataの取得でreaderがクローズされています");
            }

            while (reader.Read())
            {
                Program data = new Program();

                data.ChannelId        = Convert.ToString(DbExportCommon.GetDbInt(reader, 0));
                data.Name             = DbExportCommon.GetDbString(reader, 1);
                data.AbbreviationName = DbExportCommon.GetDbString(reader, 2);
                data.RelationId       = DbExportCommon.GetDbString(reader, 3);
                data.OnAirStart       = DbExportCommon.GetDbDateTime(reader, 4);
                data.OnAirEnd         = DbExportCommon.GetDbDateTime(reader, 5);
                data.Detail           = DbExportCommon.GetDbString(reader, 7);
                data.CreateDate       = DbExportCommon.GetDbDateTime(reader, 8);
                data.UpdateDate       = DbExportCommon.GetDbDateTime(reader, 9);

                listProgram.Add(data);
            }

            return(listProgram);
        }
コード例 #3
0
        public List <ChannelData> GetAll()
        {
            List <ChannelData> listChannel = new List <ChannelData>();

            string sql = "SELECT CHANNEL, NAME, BROADCAST_KIND, RIP_ID, VIDEO_RATE, VOICE_RATE, REMARK, CREATE_DATE, UPDATE_DATE FROM CHANNEL ";

            dbcon.openConnection();

            SqlCommand command = new SqlCommand();

            command = new SqlCommand(sql, dbcon.getSqlConnection());

            SqlDataReader reader = dbcon.GetExecuteReader(sql);

            if (reader.IsClosed)
            {
                throw new Exception("arrear.TargetAccountDataの取得でreaderがクローズされています");
            }

            while (reader.Read())
            {
                ChannelData data = new ChannelData();

                data.Channel       = DbExportCommon.GetDbInt(reader, 0);
                data.Name          = DbExportCommon.GetDbString(reader, 1);
                data.BroadcastKind = DbExportCommon.GetDbString(reader, 2);
                data.RipId         = DbExportCommon.GetDbString(reader, 3);
                data.VideoRate     = DbExportCommon.GetDbString(reader, 4);
                data.VoiceRate     = DbExportCommon.GetDbString(reader, 5);
                data.Remark        = DbExportCommon.GetDbString(reader, 6);
                data.CreateDate    = DbExportCommon.GetDbDateTime(reader, 8);
                data.UpdateDate    = DbExportCommon.GetDbDateTime(reader, 9);

                listChannel.Add(data);
            }

            return(listChannel);
        }