Beispiel #1
0
 public ActionResult Create(Pilot newPilot)
 {
     if (Valid(newPilot))
     {
         Db4oProvider.Database.Store(newPilot);        
     }
     return RedirectToAction("Index");
 }
Beispiel #2
0
        public ActionResult Edit(Guid id, Pilot editedPilot)
        {
            Pilot databasePilot = GetPilotById(id);
            databasePilot.Name = editedPilot.Name;
            databasePilot.Points = editedPilot.Points;
            Db4oProvider.Database.Store(databasePilot);

            return RedirectToAction("Index");
        }
Beispiel #3
0
 private bool Valid(Pilot pilot)
 {
     return pilot.Name.Length > 0;
 }