コード例 #1
0
        //
        //Get: /Slider/
        public ActionResult Index()
        {
            var slide = sliderservice.All(x => x.Status == true)
                        .Select(x => new Slider
            {
                Id          = x.Id,
                TitleName   = x.TitleName,
                Image       = x.Image,
                Description = x.Description.Substring(0, 100),
                URLSilder   = x.URLSilder
            });

            return(View());
        }
コード例 #2
0
        public ActionResult Index(string searchKey, DateTime?fromDate, DateTime?toDate, int?pageIndex)
        {
            ViewBag.Slider = "active";
            var model     = _Service.All(searchKey, fromDate, false, toDate, pageIndex, 20);
            int totalPage = model?.Total ?? 0;

            ViewBag.TotalPage = totalPage;
            ViewBag.pageIndex = pageIndex ?? 1;
            ViewBag.SearchKey = string.IsNullOrWhiteSpace(searchKey) ? string.Empty : searchKey;
            ViewBag.FromDate  = fromDate?.ToString("MM/dd/yyyy") ?? null;
            ViewBag.ToDate    = toDate?.ToString("MM/dd/yyyy") ?? null;
            return(View(model?.Sliders ?? new List <Slider>()));
        }