示例#1
0
 public ActionResult Edit(EventObj eventobj)
 {
     if (ModelState.IsValid)
     {
         db.Entry(eventobj).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(eventobj);
 }
示例#2
0
        public ActionResult Create(EventObj eventobj)
        {
            if (ModelState.IsValid)
            {
                db.Events.Add(eventobj);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(eventobj);
        }