Ejemplo n.º 1
0
        public ActionResult _SliderPartial()
        {
            List <Slider> Records = Slider.
                                    Query("Where Status=1").ToList();

            if (Records.Any())
            {
                foreach (var i in Records)
                {
                    string avatar = i.Image == null ? "" : i.Image;

                    if (System.IO.File.Exists(Server.MapPath(avatar)))
                    {
                        avatar = CreateThumb.ResizeImage(new[] { avatar, "thumb", "800", "1800", "", "4" });
                    }
                    i.Image = avatar;
                }
            }

            ViewBag.Sliders = Records;

            return(PartialView());
        }
Ejemplo n.º 2
0
        public ActionResult _GalleryPartial()
        {
            List <DogImageAndVideo_View00> Records = DogImageAndVideo_View00.
                                                     //Query("Select Top 12 * From Dog Where status=1 Order By NEWID()").ToList();
                                                     Query("select * from(select *, r = row_number() over(partition by Type Order By Name)from DogImageAndVideo_View00) a where r <= 4 Order By NEWID()").ToList();

            if (Records.Any())
            {
                foreach (var i in Records.Where(c => c.Type == 1))
                {
                    string avatar = i.Url == null ? "" : i.Url;

                    if (System.IO.File.Exists(Server.MapPath(avatar)))
                    {
                        avatar = CreateThumb.ResizeImage(new[] { avatar, "thumb", "800", "800", "", "4" });
                    }
                    i.Url = i.Url + "|" + avatar;
                }
            }

            ViewBag.Dogs = Records;

            return(PartialView());
        }