示例#1
0
        public List <Models.MarketViewChannelModels> GetGroupedByConfigView(string groupType)
        {
            decimal?group = StrawmanCalcs.GetGroupTypeByView(groupType);

            if (group != null)
            {
                List <StrawmanDBLibray.Entities.GROUP_MASTER> gmaster = (List <StrawmanDBLibray.Entities.GROUP_MASTER>)StrawmanDBLibrayData.Get(StrawmanDBLibray.Classes.StrawmanDataTables.GROUP_MASTER, true);
                return(gmaster.Where(m => m.TYPE == group).Select(m =>
                                                                  new Models.MarketViewChannelModels
                {
                    name = m.NAME,
                    vid = (decimal)(m.BASE_ID ?? 999999)
                }).ToList());
            }
            return(null);
        }
示例#2
0
        public List <Models.StrawmanViewSTDModel> GetGroupedByConfig(IEnumerable <Models.StrawmanViewSTDModel> query, string groupType, string type)
        {
            decimal?group = StrawmanCalcs.GetGroupTypeByView(groupType);

            if (group != null)
            {
                List <StrawmanDBLibray.Entities.GROUP_CONFIG> gchannels = (List <StrawmanDBLibray.Entities.GROUP_CONFIG>)StrawmanDBLibrayData.Get(StrawmanDBLibray.Classes.StrawmanDataTables.GROUP_CONFIG, true);
                List <StrawmanDBLibray.Entities.GROUP_MASTER> gmaster   = (List <StrawmanDBLibray.Entities.GROUP_MASTER>)StrawmanDBLibrayData.Get(StrawmanDBLibray.Classes.StrawmanDataTables.GROUP_MASTER, true);
                List <StrawmanDBLibray.Entities.BRAND_MASTER> bmaster   = (List <StrawmanDBLibray.Entities.BRAND_MASTER>)StrawmanDBLibrayData.Get(StrawmanDBLibray.Classes.StrawmanDataTables.BRAND_MASTER, true);
                var grp = gchannels.Where(m => m.TYPE_ID == group).AsEnumerable()
                          .Select(c => new Models.StrawmanViewSTDModel
                {
                    vid     = gmaster.FirstOrDefault(m => m.ID == c.GROUP_ID).BASE_ID,
                    market  = c.MARKET,
                    brand   = c.BRAND,
                    channel = bmaster.FirstOrDefault(m => m.MARKET == c.MARKET && m.ID == c.BRAND).CHANNEL,
                    config  = c.CONFIG,
                }).ToList();
                return(this.GetGroupedData(query, grp, type));
            }
            return(null);
        }