示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ModTelefone modTelefone = db.ModTelefones.Find(id);

            db.ModTelefones.Remove(modTelefone);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "ModTelefoneID,Modelo,FabricanteID,FornecedorID")] ModTelefone modTelefone)
 {
     if (ModelState.IsValid)
     {
         db.Entry(modTelefone).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FabricanteID = new SelectList(db.Fabricantes, "IdFabricante", "Nome", modTelefone.FabricanteID);
     ViewBag.FornecedorID = new SelectList(db.Fornecedors, "FornecedorID", "Nome", modTelefone.FornecedorID);
     return(View(modTelefone));
 }
示例#3
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ModTelefone modTelefone = db.ModTelefones.Find(id);

            if (modTelefone == null)
            {
                return(HttpNotFound());
            }
            return(View(modTelefone));
        }
示例#4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ModTelefone modTelefone = db.ModTelefones.Find(id);

            if (modTelefone == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FabricanteID = new SelectList(db.Fabricantes, "IdFabricante", "Nome", modTelefone.FabricanteID);
            ViewBag.FornecedorID = new SelectList(db.Fornecedors, "FornecedorID", "Nome", modTelefone.FornecedorID);
            return(View(modTelefone));
        }