예제 #1
0
        public IActionResult Edit(long id)
        {
            ViewBag.PageName = "Edit";
            Blog1 blog = Blog1.Read(id);

            ViewBag.id         = blog.id;
            ViewBag.title      = blog.title;
            ViewBag.paragraphs = blog.paragraphs;
            return(View("Add"));
        }
예제 #2
0
        public IActionResult SaveNew(long id, string title, string paragraphs)
        {
            if (id >= 1)
            {
                Blog1.Update(id, title, paragraphs);
            }
            else
            {
                Blog1.Create(title, paragraphs);
            }
            ViewBag.Message = "Your entry has been saved.";
            List <Blog1> blogs = Blog1.Read();

            return(View("Test", blogs));
        }
예제 #3
0
        public IActionResult Test(string search)
        {
            List <Blog1> blogs = Blog1.Read(search);

            return(View(blogs));
        }
예제 #4
0
        public IActionResult Blog(long id)
        {
            Blog1 blog = Blog1.Read(id);

            return(View(blog));
        }