Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Cellphone_Hardware cellphone_Hardware = db.Cellphone_Hardware.Find(id);

            db.Cellphone_Hardware.Remove(cellphone_Hardware);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,SubCategory_Id")] Cellphone_Hardware cellphone_Hardware)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cellphone_Hardware).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SubCategory_Id = new SelectList(db.Cellphone_Battery, "Id", "Name", cellphone_Hardware.SubCategory_Id);
     return(View(cellphone_Hardware));
 }
Exemple #3
0
        // GET: Cellphone_Hardware/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Cellphone_Hardware cellphone_Hardware = db.Cellphone_Hardware.Find(id);

            if (cellphone_Hardware == null)
            {
                return(HttpNotFound());
            }
            return(View(cellphone_Hardware));
        }
Exemple #4
0
        // GET: Cellphone_Hardware/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Cellphone_Hardware cellphone_Hardware = db.Cellphone_Hardware.Find(id);

            if (cellphone_Hardware == null)
            {
                return(HttpNotFound());
            }
            ViewBag.SubCategory_Id = new SelectList(db.Cellphone_Battery, "Id", "Name", cellphone_Hardware.SubCategory_Id);
            return(View(cellphone_Hardware));
        }