Ejemplo n.º 1
0
        public ActionResult Index(int page = 1)
        {
            //comment
            var banners    = _bannerService.GetAll();
            var bannerInfo = _bannerInfoService.GetAll();
            var lists      = _listsService.GetAll();
            var listInfo   = _listInfoService.GetAll();

            var model = (from b in banners
                         join bI in bannerInfo on b.BannerID equals bI.BannerID
                         join l in lists on b.BannerListID equals l.ListID
                         join lI in listInfo on l.ListID equals lI.ListID
                         select new BannersListVM
            {
                BannerID = b.BannerID,
                BannerInfoID = bI.BannerInfoID,
                Name = bI.Name,
                Banner = bI.Banner,
                CreationDate = b.CreationDate,
                Active = b.Active,
                ListType = lI.Value,
                Description = bI.Description
            }).ToPagedList(page, (int)PagingEnums.Paging.PageSize);

            return(View(model));
        }
Ejemplo n.º 2
0
        public List <ListsList> GetListType(string type)
        {
            var _lists    = _listsService.GetAll();
            var _listInfo = _listInfoService.GetAll();

            var listTypes = (from l in _lists
                             join li in _listInfo on l.ListID equals li.ListID
                             where l.Type == type
                             select new ListsList {
                ListID = l.ListID, Type = l.Type, Value = li.Value
            });

            return(listTypes.ToList());
        }
Ejemplo n.º 3
0
        public ActionResult Index(int?menuId = 0, int page = 1)
        {
            try
            {
                var menus    = _menusService.GetAll();
                var menuInfo = _menuInfoService.GetAll();

                var lists    = _listsService.GetAll();
                var listInfo = _listInfoService.GetAll();

                if (menuId > 0)
                {
                    ViewBag.MenuId = menuId;
                }
                else
                {
                    menuId = 0;
                }

                var model = (from m in menus
                             join mI in menuInfo on m.MenuID equals mI.MenuID
                             join l in lists on m.MenuListID equals l.ListID
                             join lI in listInfo on l.ListID equals lI.ListID
                             where m.ParentID == menuId
                             select new MenuListVM
                {
                    MenuID = m.MenuID,
                    MenuInfoID = mI.MenuInfoID,
                    Menu = mI.Menu,
                    MenuListID = m.MenuListID,
                    MenuYeri = lI.Value,
                    Active = m.Active,
                    CreationDate = m.CreationDate
                }
                             ).ToPagedList(page, (int)PagingEnums.Paging.PageSize);

                return(View(model));
            }
            catch (Exception ex)
            {
                TempData.Add("message", "Menü listeleme işleminde hata ile karşılaştı. Hata: " + ex.Message);
                return(View());
            }
        }