示例#1
0
        public ActionResult List()
        {
            CommunityListViewModel viewModel = new CommunityListViewModel
            {
                Communities = CommunityShedData.GetCommunityListItems(CustomUser.Person.Id)
            };

            return(View(viewModel));
        }
示例#2
0
        public ActionResult Profile()
        {
            var U_Name = Session["LogedInUser"].ToString();
            CommunityListViewModel model = new CommunityListViewModel
            {
                Communities = repository.Communities
                              .Where(p => p.Email == U_Name)
            };

            return(View(model));
        }
示例#3
0
        // 글 본문
        public CommunityListViewModel GetCommunity(int CommunityId)
        {
            var query = (from accountUser in context.AccountUsers
                         join community in context.Communitys
                         on accountUser.Id equals community.Id
                         where community.CommunityId == CommunityId
                         select new { accountUser, community }).FirstOrDefault();

            CommunityListViewModel viewModel = new CommunityListViewModel
            {
                Community   = query.community,
                AccountUser = query.accountUser
            };

            return(viewModel);
        }
示例#4
0
        public ViewResult List(int page = 1)
        {
            CommunityListViewModel model = new CommunityListViewModel
            {
                Communities = repository.Communities

                              .OrderBy(p => p.ResidentId)
                              .Skip((page - 1) * PageSize)
                              .Take(PageSize),
                PagingInfo = new PagingInfo
                {
                    CurrentPage  = page,
                    ItemsPerPage = PageSize,
                    TotalItems   = repository.Communities.Count()
                },
            };

            return(View(model));
        }