예제 #1
0
 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");
 }
예제 #2
0
 public ActionResult Edit(Event events)
 {
     if (ModelState.IsValid)
     {
         db.Entry(events).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(events);
 }