public async Task<ActionResult> Index()
    {
      var repository = new NotebookRepository();

      var myNotebooks = await repository.GetNotebooks();

      return View(myNotebooks);
    }
 public async Task<ActionResult> Delete(string id)
 {
     var repository = new NotebookRepository();
     if (id != null)
     {
         await repository.DeletePage(id);
     }
     return Redirect("/");
 }
    public async Task<ActionResult> Index(string notebookid) {
      var repository = new NotebookRepository();

      var notebook = await repository.GetNotebookSections(notebookid);

      ViewBag.CurrentNotebookTitle = notebook.Name;
      ViewBag.CurrentNotebookId = notebook.Id;

      return View(notebook.Sections.OrderBy(s => s.Name).ToList());
    }
 public async Task<ActionResult> Index(string notebookid, string sectionid)
 {
     var repository = new NotebookRepository();
     var notebook = await repository.GetNotebookPages(notebookid, sectionid);
     ViewBag.CurrentNotebookTitle = notebook.Name;
     ViewBag.CurrentNotebookId = notebook.Id;
     var section = notebook.Sections.First(s => s.Id == sectionid);
     ViewBag.CurrentSectionTitle = section.Name;
     return View(section.Pages);
 }