Exemplo n.º 1
0
 /// <summary>
 /// 產生Zone Model
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 ZonesModels GenZoneModel(AdvertisementRenderIndex item, double TempSort = 0)
 {
     return(new ZonesModels()
     {
         No = WorkLib.GetItem.NewSN(),
         SiteID = _SiteID,
         PageNo = _PageNo,
         StyleID = _StyleID,
         AreaSetID = item.AreaSetID,
         GroupPosition = item.GroupPosition,
         TempSort = TempSort,
         MenuID = item.MenuID,
         Sort = byte.MaxValue,
         ToCardStyleID = _CardStyleID
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// 設定右側廣告Card
        /// </summary>
        /// <param name="datas"></param>
        /// <param name="item"></param>
        /// <param name="Position"></param>
        private void SetRightSideAdCard(List <ZonesModels> datas, AdvertisementRenderIndex item, int Position, string TargetDataType)
        {
            foreach (var zone in datas)
            {
                long cardNo = AdvertisementRenderTools.QueryCardNoByZoneNoAndTypeStr(zone.No, TargetDataType);
                if (cardNo != 0)
                {
                    ZonesModels zonemodel = GenZoneModel(item, Position);
                    CardsModels cardmodel = AdvertisementRenderTools.GenCard(zonemodel).FirstOrDefault();

                    if (zone.CardsModels == null)
                    {
                        zone.CardsModels = new List <CardsModels>();
                    }

                    zone.CardsModels.Add(cardmodel);
                    zone.StyleID = 9;
                    break;
                }
            }
        }