public ActionResult DeleteConfirmed(int id) { tblGenero tblGenero = db.tblGenero.Find(id); db.Database.ExecuteSqlCommand("DELETE FROM tblArticulo WHERE idGenero = @idGenero", new SqlParameter("idGenero", tblGenero.idGenero) ); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "idGenero,Genero")] tblGenero tblGenero) { if (ModelState.IsValid) { db.Database.ExecuteSqlCommand("UPDATE tblEstado SET idGenero = @idGenero, Genero = @Genero", new SqlParameter("Genero", tblGenero.Genero) ); return(RedirectToAction("Index")); } return(View(tblGenero)); }
public ActionResult Create([Bind(Include = "idGenero,Genero")] tblGenero tblGenero) { if (ModelState.IsValid) { db.Database.ExecuteSqlCommand("INSERT into tblGenero VALUES (@Genero)", new SqlParameter("Genero", tblGenero.Genero) ); return(RedirectToAction("Index")); } return(View(tblGenero)); }
// GET: tblGeneros/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblGenero tblGenero = db.tblGenero.Find(id); if (tblGenero == null) { return(HttpNotFound()); } return(View(tblGenero)); }
public GeneroItem(tblGenero Genero) { this.Genero = Genero; }