public ActionResult DeleteConfirmed(int id) { TrainingFocuses trainingFocuses = db.TrainingFocuses.Find(id); db.TrainingFocuses.Remove(trainingFocuses); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,TrainingFocusName,SeasonPart")] TrainingFocuses trainingFocuses) { if (ModelState.IsValid) { db.Entry(trainingFocuses).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SeasonPart = new SelectList(db.SeasonParts, "Id", "SeasonPartName", trainingFocuses.SeasonPart); return(View(trainingFocuses)); }
// GET: TrainingFocuses/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TrainingFocuses trainingFocuses = db.TrainingFocuses.Find(id); if (trainingFocuses == null) { return(HttpNotFound()); } return(View(trainingFocuses)); }
// GET: TrainingFocuses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TrainingFocuses trainingFocuses = db.TrainingFocuses.Find(id); if (trainingFocuses == null) { return(HttpNotFound()); } ViewBag.SeasonPart = new SelectList(db.SeasonParts, "Id", "SeasonPartName", trainingFocuses.SeasonPart); return(View(trainingFocuses)); }