Esempio n. 1
0
        public ActionResult CreateComment(string id, string text)
        {
            Account account = (Account)(Session["user"]);

            accountRepository.GetById(account.Id);
            repository.InsertComment(Convert.ToInt32(id), account.Id, text);
            List <Bericht>     berichtenList = repository.LoadBerichtenByPostId(Convert.ToInt32(id));
            BerichtenViewModel bvm           = new BerichtenViewModel {
                berichtenList = berichtenList, account = account
            };

            return(PartialView("Comments", bvm));
        }
Esempio n. 2
0
        public ActionResult LoadBerichtenByPostId(int id)
        {
            Account account = (Account)(Session["user"]);

            accountRepository.GetById(account.Id);
            List <Bericht>     berichtenList = repository.LoadBerichtenByPostId(id);
            BerichtenViewModel bvm           = new BerichtenViewModel {
                berichtenList = berichtenList, account = account
            };

            if (berichtenList.Count == 0)
            {
                return(PartialView("NoComments"));
            }
            else
            {
                return(PartialView("Comments", bvm));
            }
        }