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

            db.bonhoes.Remove(bonho);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id,maSp,tensp,ram,bonhotrong,bonhokhadung,thenhongoai,hotrothetoida")] bonho bonho)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bonho).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bonho));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "id,maSp,tensp,ram,bonhotrong,bonhokhadung,thenhongoai,hotrothetoida")] bonho bonho)
        {
            if (ModelState.IsValid)
            {
                db.bonhoes.Add(bonho);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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