예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TrainingFocuses trainingFocuses = db.TrainingFocuses.Find(id);

            db.TrainingFocuses.Remove(trainingFocuses);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 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));
 }
예제 #3
0
        // 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));
        }
예제 #4
0
        // 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));
        }