コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Organisers organisers = db.Organisers.Find(id);

            db.Organisers.Remove(organisers);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "OrganiserId,HireDateTime,FirstName,LastName,Email,ContactNumber")] Organisers organisers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(organisers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(organisers));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "OrganiserId,HireDateTime,FirstName,LastName,Email,ContactNumber")] Organisers organisers)
        {
            if (ModelState.IsValid)
            {
                db.Organisers.Add(organisers);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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