Exemplo n.º 1
0
        public ActionResult Render(long SiteID, long ZoneNo)
        {
            List <ImageTextModel> imageTextList = new List <ImageTextModel>();
            var Zone  = CardsDAO.GetZoneInfo(ZoneNo);
            var Cards = CardsDAO.GetZoneData(SiteID, ZoneNo);

            string RenderViewFileName = "~/Views/Article/ImageTextListStyleDefault.cshtml";

            if (Cards != null && Cards.Count > 0)
            {
                foreach (CardsModels Card in Cards)
                {
                    if (Card.CardsType == "Article")
                    {
                        WorkV3.Common.SitePage curPage = WorkV3.Models.DataAccess.CardsDAO.GetPage(Card.No);
                        ViewBag.UploadVPath = UpdFileInfo.GetVPathByMenuID(curPage.SiteID, curPage.MenuID);
                        var article = ArticleDAO.GetItemByCard(Card.No);
                        if (article != null)
                        {
                            imageTextList = ImageTextDAO.Get(article.ID, true, null);
                            string ViewFileName = string.Format("~/Views/Article/ImageTextListStyle{0}.cshtml", Card.StylesID.ToString());
                            if (System.IO.File.Exists(Server.MapPath(ViewFileName)))
                            {
                                RenderViewFileName = ViewFileName;
                            }
                        }
                    }
                }
            }
            return(View(RenderViewFileName, imageTextList));
        }
Exemplo n.º 2
0
        public ActionResult Index(CardsModels model)
        {
            WorkV3.Common.SitePage curPage = WorkV3.Models.DataAccess.CardsDAO.GetPage(model.No);
            ViewBag.UploadVPath = UpdFileInfo.GetVPathByMenuID(curPage.SiteID, curPage.MenuID);

            ViewBag.SitePage = curPage;

            var data = MainVisionDAO.Get(model.No, true);

            if (data.Count == 0)
            {
                return(null);
            }

            return(View("Style" + model.StylesID, data));
        }
Exemplo n.º 3
0
        public ActionResult Index(CardsModels model)
        {
            var datas = ParallaxDAO.Get(model.No, true);

            if (datas.Count == 0)
            {
                return(null);
            }

            int index = new Random().Next(datas.Count);
            var data  = datas[index];

            WorkV3.Common.SitePage curPage = WorkV3.Models.DataAccess.CardsDAO.GetPage(model.No);
            ViewBag.UploadVPath = UpdFileInfo.GetVPathByMenuID(curPage.SiteID, curPage.MenuID);
            ViewBag.ImgSrc      = JsonConvert.DeserializeObject <ImageModel>(data.Img).Img;

            return(View(data));
        }
Exemplo n.º 4
0
        public ActionResult Zone(ZonesModels Zone)
        {
            List <CardsModels> Cards;

            ViewBag.ZoneNo = Zone.No;

            //取得該Zone底下的Card集合
            if (Zone.AreaSetID == null)
            {
                Cards = CardsDAO.GetZoneData(Zone.SiteID, Zone.No);
                if (Cards != null && Zone.CardsModels != null)
                {
                    //Zone.CardsModels 有資料時代表有右側廣告
                    List <CardsModels> RightSideAd = Zone.CardsModels.OrderBy(m => m.TempSort).ToList();
                    foreach (CardsModels card in Cards)
                    {
                        RightSideAd.Insert(0, card);
                    }
                    Cards = RightSideAd;
                }
            }
            else
            {
                Cards = AdvertisementRenderTools.GenCard(Zone); //AreaSetID不為Null代表為廣告
            }
            var articleCars = Cards.Where(card => card.CardsType == "Article");

            if (articleCars != null && articleCars.Count() > 0)
            {
                WorkV3.Common.SitePage curPage = WorkV3.Models.DataAccess.CardsDAO.GetPage(articleCars.First().No);
                var article = ArticleDAO.GetItemByCard(articleCars.First().No);
                if (article != null)
                {
                    var imageTextList = ImageTextDAO.Get(article.ID, true, null);
                    if (imageTextList != null && imageTextList.Count() > 0)
                    {
                        Zone.StyleID = 9;
                    }
                }
            }
            return(PartialView("Zones/_Style" + Zone.StyleID, Cards));
        }
Exemplo n.º 5
0
 public ActionResult Index(CardsModels model)
 {
     WorkV3.Common.SitePage curPage = WorkV3.Models.DataAccess.CardsDAO.GetPage(model.No);
     ViewBag.UploadVPath = UpdFileInfo.GetVPathByMenuID(curPage.SiteID, curPage.MenuID);
     return(View(model));
 }