예제 #1
0
        public ActionResult Create(SocialBlogStat socialblogstat)
        {
            if (ModelState.IsValid)
            {
                db.SocialBlogStats.Add(socialblogstat);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.BlogId = new SelectList(db.Blogs, "Id", "Title", socialblogstat.BlogId);
            return View(socialblogstat);
        }
예제 #2
0
 public ActionResult Edit(SocialBlogStat socialblogstat)
 {
     if (ModelState.IsValid)
     {
         db.Entry(socialblogstat).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.BlogId = new SelectList(db.Blogs, "Id", "Title", socialblogstat.BlogId);
     return View(socialblogstat);
 }