예제 #1
0
        public ActionResult CreateNewBericht()
        {
            List <Categorie> categorieList = categorieRepository.CategorieList();
            Account          account       = (Account)(Session["user"]);

            accountRepository.GetById(account.Id);
            NewBerichtViewModel bvm = new NewBerichtViewModel()
            {
                categorieList = categorieList, account = account
            };

            return(PartialView("CreateNewBericht", bvm));
        }
예제 #2
0
 public ActionResult CreateNewBericht(NewBerichtViewModel mvm)
 {
     try
     {
         Account account = (Account)(Session["user"]);
         accountRepository.GetById(account.Id);
         repository.InsertPost(mvm.bericht.Titel, mvm.bericht.Inhoud, account.Id, mvm.selectedCategorieId);
         return(RedirectToAction("Index", "MediaSharing"));
     }
     catch
     {
         return(View("Error"));
     }
 }