コード例 #1
0
    public async Task<ActionResult> Index()
    {
      var repository = new NotebookRepository();

      var myNotebooks = await repository.GetNotebooks();

      return View(myNotebooks);
    }
コード例 #2
0
 public async Task<ActionResult> Delete(string id)
 {
     var repository = new NotebookRepository();
     if (id != null)
     {
         await repository.DeletePage(id);
     }
     return Redirect("/");
 }
コード例 #3
0
    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());
    }
コード例 #4
0
 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);
 }