예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            unica unica = db.unicas.Find(id);

            db.unicas.Remove(unica);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Nome,Idade,Telefone")] unica unica)
 {
     if (ModelState.IsValid)
     {
         db.Entry(unica).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(unica));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "Id,Nome,Idade,Telefone")] unica unica)
        {
            if (ModelState.IsValid)
            {
                db.unicas.Add(unica);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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