Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbl_volunteer_posting tbl_volunteer_posting = db.tbl_volunteer_posting.Find(id);

            db.tbl_volunteer_posting.Remove(tbl_volunteer_posting);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,title,content,admin_id,date_created")] tbl_volunteer_posting tbl_volunteer_posting)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_volunteer_posting).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.admin_id = new SelectList(db.tbl_admin, "Id", "first_name", tbl_volunteer_posting.admin_id);
     return(View(tbl_volunteer_posting));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "Id,title,content,admin_id")] tbl_volunteer_posting tbl_volunteer_posting)
        {
            if (ModelState.IsValid)
            {
                tbl_volunteer_posting.date_created = DateTime.Now;
                db.tbl_volunteer_posting.Add(tbl_volunteer_posting);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.admin_id = new SelectList(db.tbl_admin, "Id", "first_name", tbl_volunteer_posting.admin_id);
            return(View(tbl_volunteer_posting));
        }
Exemple #4
0
        // GET: volunteerposting/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_volunteer_posting tbl_volunteer_posting = db.tbl_volunteer_posting.Find(id);

            if (tbl_volunteer_posting == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_volunteer_posting));
        }
Exemple #5
0
        // GET: volunteerposting/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_volunteer_posting tbl_volunteer_posting = db.tbl_volunteer_posting.Find(id);

            if (tbl_volunteer_posting == null)
            {
                return(HttpNotFound());
            }
            ViewBag.admin_id = new SelectList(db.tbl_admin, "Id", "first_name", tbl_volunteer_posting.admin_id);
            return(View(tbl_volunteer_posting));
        }