public ActionResult Create(Event events) { events.Author = db.GetUserFromMember(Membership.GetUser()).DisplayName; events.AuthorID = db.GetUserFromMember(Membership.GetUser()).Id; db.Events.Add(events); db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Edit(Event events) { if (ModelState.IsValid) { db.Entry(events).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(events); }