示例#1
0
 public ActionResult Create(EditMeetingModel model)
 {
     if (ModelState.IsValid)
     {
         var meeting = new Meeting();
         model.MapTo(meeting);
         repository.Add(meeting);
         repository.SaveAllChanges();
         return RedirectToAction("Index");
     }
     return View(model);
 }
示例#2
0
 public ActionResult Edit(int id, EditMeetingModel model)
 {
     if (ModelState.IsValid)
     {
         var meeting = GetMeeting(id);
         model.MapTo(meeting);
         repository.SaveAllChanges();
         return RedirectToAction("Index");
     }
     return View(model);
 }