Exemple #1
0
        private void ReadChannels(SQLiteCommand cmd)
        {
            string[] fieldNames =
            {
                "rowid",         "major_channel", "physical_ch",   "sname",         "freq",  "skip", "running_status", "free_CA_mode", "child_lock",
                "profile1index", "profile2index", "profile3index", "profile4index", "stype", "onid", "tsid",           "svcid",        "ntype",     "ya_svcid",
                "delivery",      "delivery_type"
            };

            string sql = string.Join(" ",
                                     "SELECT",
                                     "s.rowid, s.major_channel, s.physical_ch, cast(s.sname as blob), t.freq, s.skip, s.running_status,",
                                     "s.free_CA_mode, s.child_lock, s.profile1index, s.profile2index, s.profile3index, s.profile4index, s.stype,",
                                     "s.onid, s.tsid, s.svcid, s.ntype, s.ya_svcid, t.delivery, ifnull(t.delivery_type, 0)",
                                     "FROM SVL s",
                                     "LEFT OUTER JOIN TSL t ON s.physical_ch = t.physical_ch and s.tsid = t.tsid",
                                     "ORDER BY s.ntype, major_channel");

            var fields = GetFieldMap(fieldNames);

            cmd.CommandText = sql;
            using (var r = cmd.ExecuteReader())
            {
                while (r.Read())
                {
                    ChannelInfo channel = new DbChannel(r, fields, DataRoot, DefaultEncoding);
                    if (!channel.IsDeleted)
                    {
                        ChannelList channelList = DataRoot.GetChannelList(channel.SignalSource);

                        if (channelList != null)
                        {
                            DataRoot.AddChannel(channelList, channel);
                        }
                    }
                }
            }
        }
Exemple #2
0
        private void ReadChannels(SQLiteCommand cmd)
        {
            string[] fieldNames = { "rowid", "major_channel", "physical_ch","sname", "freq", "skip", "running_status","free_CA_mode","child_lock",
                            "profile1index","profile2index","profile3index","profile4index","stype", "onid", "tsid", "sid", "ntype", "ya_svcid", "delivery" };

              const string sql = @"
            select s.rowid,s.major_channel,s.physical_ch,cast(s.sname as blob),t.freq,s.skip,s.running_status,s.free_CA_mode,s.child_lock,
              profile1index,profile2index,profile3index,profile4index,s.stype,s.onid,s.tsid,s.svcid,s.ntype,s.ya_svcid,delivery
            from SVL s
            left outer join TSL t on s.ntype=t.ntype and s.physical_ch=t.physical_ch and s.tsid=t.tsid
            order by s.ntype,major_channel
            ";

              var fields = this.GetFieldMap(fieldNames);

              cmd.CommandText = sql;
              using (var r = cmd.ExecuteReader())
              {
            while (r.Read())
            {
              ChannelInfo channel = new DbChannel(r, fields, this.DataRoot, this.DefaultEncoding);
              if (!channel.IsDeleted)
              {
            var channelList = this.DataRoot.GetChannelList(channel.SignalSource);
            if (channelList != null)
              this.DataRoot.AddChannel(channelList, channel);
              }
            }
              }
        }