Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BrigadeMembers brigadeMembers = db.BrigadeMembers.Find(id);

            db.BrigadeMembers.Remove(brigadeMembers);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "BrigadeMembersId,BrigadeId,WorkerId")] BrigadeMembers brigadeMembers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(brigadeMembers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BrigadeId = new SelectList(db.Brigades, "BrigadeId", "BrigadeName", brigadeMembers.BrigadeId);
     ViewBag.WorkerId  = new SelectList(db.Workers, "WorkerId", "WorkerName", brigadeMembers.WorkerId);
     return(View(brigadeMembers));
 }
Esempio n. 3
0
        // GET: BrigadeMembers/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BrigadeMembers brigadeMembers = db.BrigadeMembers.Find(id);

            if (brigadeMembers == null)
            {
                return(HttpNotFound());
            }
            return(View(brigadeMembers));
        }
Esempio n. 4
0
        // GET: BrigadeMembers/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BrigadeMembers brigadeMembers = db.BrigadeMembers.Find(id);

            if (brigadeMembers == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BrigadeId = new SelectList(db.Brigades, "BrigadeId", "BrigadeName", brigadeMembers.BrigadeId);
            ViewBag.WorkerId  = new SelectList(db.Workers, "WorkerId", "WorkerName", brigadeMembers.WorkerId);
            return(View(brigadeMembers));
        }