Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            visiting visiting = db.visitings.Find(id);

            db.visitings.Remove(visiting);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id,title,description_visiting,date_visiting")] visiting visiting)
 {
     if (ModelState.IsValid)
     {
         db.Entry(visiting).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(visiting));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "id,title,description_visiting,date_visiting")] visiting visiting)
        {
            if (ModelState.IsValid)
            {
                db.visitings.Add(visiting);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(visiting));
        }
Exemplo n.º 4
0
        // GET: visitings/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            visiting visiting = db.visitings.Find(id);

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