コード例 #1
0
        public ActionResult DeleteConfirmed(Int32 id)
        {
            VolunteerCommitments volunteercommitments = db.VolunteerCommitments.Find(id);

            db.VolunteerCommitments.Remove(volunteercommitments);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        //
        // GET: /VolunteerCommitments/Delete/5
        public ActionResult Delete(Int32 id)
        {
            VolunteerCommitments volunteercommitments = db.VolunteerCommitments.Find(id);

            if (volunteercommitments == null)
            {
                return(HttpNotFound());
            }
            return(View(volunteercommitments));
        }
コード例 #3
0
        //
        // GET: /VolunteerCommitments/Edit/5
        public ActionResult Edit(Int32 id)
        {
            VolunteerCommitments volunteercommitments = db.VolunteerCommitments.Find(id);

            if (volunteercommitments == null)
            {
                return(HttpNotFound());
            }
            //ViewBag.EventID = new SelectList(db.VolunteerEvents, "EventID", "EventName", volunteercommitments.EventID);
            PopulateEventDropDownList(volunteercommitments.EventID);
            ViewBag.RoleID = new SelectList(db.VolunteerRoles, "RoleID", "Role", volunteercommitments.RoleID);
            return(View(volunteercommitments));
        }
コード例 #4
0
 public ActionResult Edit(VolunteerCommitments volunteercommitments)
 {
     if (ModelState.IsValid)
     {
         db.Entry(volunteercommitments).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     // ViewBag.EventID = new SelectList(db.VolunteerEvents, "EventID", "EventName", volunteercommitments.EventID);
     PopulateEventDropDownList(volunteercommitments.EventID);
     ViewBag.RoleID = new SelectList(db.VolunteerRoles, "RoleID", "Role", volunteercommitments.RoleID);
     return(View(volunteercommitments));
 }
コード例 #5
0
        public ActionResult Create(VolunteerCommitments volunteercommitments)
        {
            if (ModelState.IsValid)
            {
                db.VolunteerCommitments.Add(volunteercommitments);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EventID = new SelectList(db.VolunteerEvents, "EventID", "EventName", volunteercommitments.EventID);
            PopulateEventDropDownList(volunteercommitments.EventID);
            ViewBag.RoleID = new SelectList(db.VolunteerRoles, "RoleID", "Role", volunteercommitments.RoleID);
            return(View(volunteercommitments));
        }