Exemplo n.º 1
0
 public ActionResult EditProfile([Bind(Include = "ID,FirstName,LastName,PreferredName,Active,ASPNetIdentityID,ProfilePic")] Person person)
 {
     if (ModelState.IsValid)
     {
         db.Entry(person).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(person));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ID,Completed,Note,AthleteID,WorkoutID")] Record record)
 {
     if (ModelState.IsValid)
     {
         db.Entry(record).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(record));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "WorkoutsId,WorkoutDate,TeamID")] Workout workout)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workout).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TeamID = new SelectList(db.Teams, "TeamId", "TeamName", workout.TeamID);
     return(View(workout));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "ID,TeamName,CoachID")] Team team)
 {
     if (ModelState.IsValid)
     {
         db.Entry(team).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CoachID = new SelectList(db.Coaches, "ID", "ID", team.CoachID);
     return(View(team));
 }
Exemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "ExerciseRecordId,ComplexReps,ComplexSets,LiftWeight,RunSpeed,RunTime,RunDistance,ExerciseID,AthleteID")] ExerciseRecord exerciseRecord)
 {
     if (ModelState.IsValid)
     {
         db.Entry(exerciseRecord).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AthleteID  = new SelectList(db.Athletes, "ID", "Sex", exerciseRecord.AthleteID);
     ViewBag.ExerciseID = new SelectList(db.Exercises, "ID", "Name", exerciseRecord.ExerciseID);
     return(View(exerciseRecord));
 }
 public ActionResult Edit([Bind(Include = "ID,Sex,Gender,DOB,Height,Weight,TeamID")] Athlete athlete)
 {
     if (ModelState.IsValid)
     {
         db.Entry(athlete).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ID     = new SelectList(db.Persons, "ID", "FirstName", athlete.ID);
     ViewBag.TeamID = new SelectList(db.Teams, "ID", "TeamName", athlete.TeamID);
     return(View(athlete));
 }