Exemplo n.º 1
0
        public void TestAddBlog()
        {
            BlogDao.Delete("0fd98278b1a549638556ca029b1dffe8");
            BlogDao.Delete("3b5df9babcc64ec4a49599e10272c365");

            var blog = new Blog();

            blog.Summary    = "";
            blog.CreateTime = DateTime.Now;
            blog.ID         = Guid.NewGuid().ToString("N");

            BlogDao.Create(blog);

            blog.Summary = "<p>&nbsp;&nbsp;直接抢劫了现成的模板,在网络上挖上一个专属自己的坑。</p>";
            BlogDao.Update(blog);

            BlogDao.Delete(blog.ID);
        }
Exemplo n.º 2
0
        public ActionResult DeleteBlog(int id)
        {
            try
            {
                BlogDao blogDao = new BlogDao();
                Blog    blog    = blogDao.GetById(id);


                blogDao.Delete(blog);

                TempData["message-success"] = "Blog " + blog.Header + " byl smazan";
            }
            catch (Exception e)
            {
                throw;
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 public static void DeleteBloe(string id)
 {
     BlogDao.Delete(id);
 }