예제 #1
0
        public async Task <ActionResult> BlockRssBindManage(string id)
        {
            //var categoryModel = await ContentManagerRepository.CategoryInfo(id);
            //var UserId = Util.Common.My.id;
            //var UserCategories = await ContentManagerRepository.GetUserCategories(UserId);
            //var ParentTitle = string.Empty;

            //if (string.IsNullOrWhiteSpace(categoryModel.userid))
            //    categoryModel.userid = Util.Common.My.id;

            //if (!string.IsNullOrEmpty(categoryModel.parentId) && categoryModel.parentId != "-1")
            //    ParentTitle = (await ContentManagerRepository.CategoryInfo(categoryModel.parentId)).title;
            var UserId  = Util.Common.My.id;
            var UserRss = await ContentManagerRepository.GetUserAllRss(UserId);

            var RssSitesInfo = await ContentManagerRepository.SitesInfo(UserRss);

            var UserCategories = await ContentManagerRepository.GetUserCategories(UserId);

            var RssSitesName = new List <Tuple <string, string> >();

            foreach (var rss in UserRss)
            {
                var SiteInfo = RssSitesInfo.FirstOrDefault(q => q._id == rss.siteid);
                RssSitesName.Add(new Tuple <string, string>(rss._id, SiteInfo.title));
            }
            var model = new ViewModel.ContentManager.SimpleCategoryRssBindManageVM()
            {
                Rss          = UserRss,
                Categories   = UserCategories,
                UserId       = UserId,
                RssSitesName = RssSitesName
            };

            return(View(model));
        }