Example #1
0
        public List <Model.Config> GetConfigs(Common.DataContext ctx)
        {
            //var tb = this.Select(ctx, new Model.Config() {State = 0});
            var tb = ctx.ExecuteDataTable("Select * From Config Where State<>255");

            if (tb != null && tb.Rows.Count > 0)
            {
                return(tb.ToList <Model.Config>().OrderBy(c => c.Code).ToList());
            }

            return(new List <Model.Config>());
        }
Example #2
0
        public List <Model.Channel> GetChannels(Common.DataContext ctx)
        {
            var tb = ctx.ExecuteDataTable("Select [ID],Code,Name as CName,ParentId,Case ParentId when 0 then [Name] else '|--'+[Name] end [Name],[Type],[ContentType],Case ParentId when 0 then ID else ParentId end sortId from [Channel] where State <> 255 order by sortId");

            if (tb != null && tb.Rows.Count > 0)
            {
                var channels = tb.ToList <Model.Channel>();
                return(channels);
            }

            return(new List <Model.Channel>());
        }