public ActionResult DeleteConfirmed(int id) { itbis itbis = db.itbis.Find(id); db.itbis.Remove(itbis); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,valor")] itbis itbis) { if (ModelState.IsValid) { db.Entry(itbis).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(itbis)); }
// GET: itbis/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } itbis itbis = db.itbis.Find(id); if (itbis == null) { return(HttpNotFound()); } return(View(itbis)); }
public ActionResult Create([Bind(Include = "id,valor")] itbis itbis) { if (ModelState.IsValid) { var usuarioid = Session["userid"].ToString(); var empresaid = Session["empresaid"].ToString(); itbis.usuarioid = Convert.ToInt32(usuarioid); itbis.empresaid = Convert.ToInt32(empresaid); db.itbis.Add(itbis); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(itbis)); }
// GET: itbis/Edit/5 public ActionResult Edit(int?id) { if (Session["Username"] == null) { return(RedirectToAction("Login", "Logins")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } itbis itbis = db.itbis.Find(id); if (itbis == null) { return(HttpNotFound()); } return(View(itbis)); }