public ActionResult ViewChapter(int ID)
        {
            int StoryID = Convert.ToInt32(Session["StoryID"]);

            HoofdstukViewModel H = Repo.ToViewModel(Repo.getSingleHoofdstuk(ID, StoryID));

            return(View("SingleChapter", H));
        }
        public ActionResult SubmitChapter(HoofdstukViewModel H)
        {
            string    Titel   = H.Titel;
            string    Body    = H.Body;
            int       Nummer  = Convert.ToInt32(H.nummer);
            int       storyID = Convert.ToInt32(Session["StoryID"]);
            Hoofdstuk D       = new Hoofdstuk(Titel, Body, Nummer, storyID);

            Repo.AddHoofdstuk(D);

            return(RedirectToAction("Index", "Verhaal"));
        }
Exemple #3
0
        public List <HoofdstukViewModel> ToListViewModel(List <Hoofdstuk> Hoofdstukken)
        {
            List <HoofdstukViewModel> HL = new List <HoofdstukViewModel>();
            HoofdstukViewModel        H;

            foreach (Hoofdstuk F in Hoofdstukken)
            {
                H = new HoofdstukViewModel(F.Titel, F.Body, F.Nummer, F.VerhaalID, F.HoofdstukID);
                HL.Add(H);
            }

            return(HL);
        }
 public ActionResult Index(HoofdstukViewModel H)
 {
     return(View("Hoofdstuk"));
 }
Exemple #5
0
        public HoofdstukViewModel ToViewModel(Hoofdstuk H)
        {
            HoofdstukViewModel F = new HoofdstukViewModel(H.Titel, H.Body, H.Nummer, H.VerhaalID, H.HoofdstukID);

            return(F);
        }