public ActionResult DeleteConfirmed(int id)
        {
            PARTICIPANTS pARTICIPANTS = db.PARTICIPANTS.Find(id);

            db.PARTICIPANTS.Remove(pARTICIPANTS);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult Potwierdzenie_usunieciaDr(int id)
        {
            PARTICIPANTS pARTICIPANTS = db.PARTICIPANTS.Find(id);

            db.PARTICIPANTS.Remove(pARTICIPANTS);
            db.SaveChanges();
            return(RedirectToAction("Druzyny"));
        }
 public ActionResult Edit([Bind(Include = "Participants_ID,Season_ID,Driver_ID,Team_ID")] PARTICIPANTS pARTICIPANTS)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pARTICIPANTS).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Driver_ID = new SelectList(db.DRIVERS, "Driver_ID", "Driver_Name", pARTICIPANTS.Driver_ID);
     ViewBag.Season_ID = new SelectList(db.SEASONS, "Season_ID", "Year", pARTICIPANTS.Season_ID);
     ViewBag.Team_ID   = new SelectList(db.TEAMS, "Team_ID", "Team_Name", pARTICIPANTS.Team_ID);
     return(View(pARTICIPANTS));
 }
        // GET: PARTICIPANTS/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PARTICIPANTS pARTICIPANTS = db.PARTICIPANTS.Find(id);

            if (pARTICIPANTS == null)
            {
                return(HttpNotFound());
            }
            return(View(pARTICIPANTS));
        }
示例#5
0
        public ActionResult Stworz_druzyne([Bind(Include = "Participants_ID,Season_ID,Driver_ID,Team_ID")] PARTICIPANTS pARTICIPANTS)
        {
            if (ModelState.IsValid)
            {
                db.PARTICIPANTS.Add(pARTICIPANTS);
                db.SaveChanges();
                return(RedirectToAction("Druzyny"));
            }

            ViewBag.Driver_ID = new SelectList(db.DRIVERS, "Driver_ID", "Driver_Name", pARTICIPANTS.Driver_ID);
            ViewBag.Season_ID = new SelectList(db.SEASONS, "Season_ID", "Year", pARTICIPANTS.Season_ID);
            ViewBag.Team_ID   = new SelectList(db.TEAMS, "Team_ID", "Team_Name", pARTICIPANTS.Team_ID);
            return(View(pARTICIPANTS));
        }
        // GET: PARTICIPANTS/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PARTICIPANTS pARTICIPANTS = db.PARTICIPANTS.Find(id);

            if (pARTICIPANTS == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Driver_ID = new SelectList(db.DRIVERS, "Driver_ID", "Driver_Name", pARTICIPANTS.Driver_ID);
            ViewBag.Season_ID = new SelectList(db.SEASONS, "Season_ID", "Year", pARTICIPANTS.Season_ID);
            ViewBag.Team_ID   = new SelectList(db.TEAMS, "Team_ID", "Team_Name", pARTICIPANTS.Team_ID);
            return(View(pARTICIPANTS));
        }