Beispiel #1
0
        public static void createBlog(string BlogContent, int OwnerID, string Title)
        {
            m_BlogContext db1 = new m_BlogContext();

            db1.m_Blogs.Add(new m_Blog()
            {
                ownerid          = OwnerID,
                title            = Title,
                content          = filter(BlogContent),
                classify         = "",
                last_modify_time = DateTime.Now,
                visit_count      = 0
            });
            db1.SaveChanges();
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "ID,ownerid,title,content,visit_count,last_modify_time,classify")] m_Blog m_Blog)
        {
            if (ModelState.IsValid)
            {
                db.m_Blogs.Add(m_Blog);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(m_Blog));
        }