示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            user_event user_event = db.user_event.Find(id);

            db.user_event.Remove(user_event);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "user_event_ID,userId,eventID")] user_event user_event)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user_event).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(user_event));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "user_event_ID,userId,eventID")] user_event user_event)
        {
            if (ModelState.IsValid)
            {
                db.user_event.Add(user_event);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(user_event));
        }
示例#4
0
        // GET: user_event/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            user_event user_event = db.user_event.Find(id);

            if (user_event == null)
            {
                return(HttpNotFound());
            }
            return(View(user_event));
        }