示例#1
0
        public ActionResult ViewPost(int id)
        {
            Post         post = _postRepo.GetById(id);
            UpdatePostVM data = new UpdatePostVM();

            data.PostDTO.Id        = post.Id;
            data.PostDTO.Header    = post.Header;
            data.PostDTO.Content   = post.Content;
            data.PostDTO.ImagePath = post.ImagePath;
            return(View(data));
        }
示例#2
0
        public ActionResult Update(int id)
        {
            Post         post = _postRepo.GetById(id);
            UpdatePostVM data = new UpdatePostVM();

            data.PostDTO.Id        = post.id;
            data.PostDTO.Header    = post.Header;
            data.PostDTO.Content   = post.Content;
            data.PostDTO.ImagePath = post.ImagePath;
            data.Categories        = _categoryRepo.GetActive();
            data.AppUsers          = _appUserRepo.GetDefault(x => x.Role != Role.Member);
            return(View(data));
        }
示例#3
0
        public ActionResult Update(int id)
        {
            Post         post  = _postService.GetById(id);
            UpdatePostVM model = new UpdatePostVM();

            model.PostDTO.Id        = post.Id;
            model.PostDTO.Header    = post.Header;
            model.PostDTO.Content   = post.Content;
            model.PostDTO.ImagePath = post.ImagePath;
            model.Categories        = _categoryService.GetActive();
            model.AppUsers          = _appUserService.GetActive();
            return(View(model));
        }
示例#4
0
        public ActionResult Update(int id)
        {
            Post         post  = _postRepository.GetById(id);
            UpdatePostVM model = new UpdatePostVM();

            model.PostDTO.Id          = post.Id;
            model.PostDTO.Header      = post.Header;
            model.PostDTO.Content     = post.Content;
            model.PostDTO.PublishDate = post.PublishDate;
            model.PostDTO.ImagePath   = post.ImagePath;

            List <Category> categories = _categoryRepository.GetActive();

            model.Categories = categories;

            List <AppUser> appUsers = _appUserRepository.GetActive();

            model.AppUsers = appUsers;

            return(View(model));
        }