Beispiel #1
0
 public ActionResult Edit([Bind(Include = "UserId,Email,UserRoleID")] Account account)
 {
     if (ModelState.IsValid)
     {
         db.Entry(account).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(account));
 }
 public ActionResult Edit([Bind(Include = "GroupId,GroupName")] MuscleGroup muscleGroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(muscleGroup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(muscleGroup));
 }
Beispiel #3
0
 public ActionResult Edit([Bind(Include = "ExerciseId,ExerciseName,ExerciseDescription,GroupId")] Exercise exercise)
 {
     if (ModelState.IsValid)
     {
         db.Entry(exercise).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GroupId = new SelectList(db.MuscleGroups, "GroupId", "GroupName", exercise.GroupId);
     return(View(exercise));
 }
Beispiel #4
0
 public ActionResult Edit([Bind(Include = "WorkoutId,WorkoutName,UserId")] Workout workout)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workout).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.Accounts, "UserId", "Email", workout.UserId);
     return(View(workout));
 }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "CommentId,UserId,WorkoutId,CommentDateTime,TextBody")] Comment comment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(comment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId    = new SelectList(db.Accounts, "UserId", "Email", comment.UserId);
     ViewBag.WorkoutId = new SelectList(db.Workouts, "WorkoutId", "WorkoutName", comment.WorkoutId);
     return(View(comment));
 }
 public ActionResult Edit([Bind(Include = "StepId,WorkoutId,ExerciseId,WorkoutOrder,RepsNumber,SetsNumber")] WorkoutStep workoutStep)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workoutStep).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ExerciseId = new SelectList(db.Exercises, "ExerciseId", "ExerciseName", workoutStep.ExerciseId);
     ViewBag.WorkoutId  = new SelectList(db.Workouts, "WorkoutId", "WorkoutName", workoutStep.WorkoutId);
     return(View(workoutStep));
 }