public ActionResult DeleteConfirmed(int id) { BoughtAsset boughtAsset = db.BoughtAssets.Find(id); db.BoughtAssets.Remove(boughtAsset); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,CreationDate")] BoughtAsset boughtAsset) { if (ModelState.IsValid) { db.Entry(boughtAsset).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(boughtAsset)); }
public ActionResult Create([Bind(Include = "Id,CreationDate")] BoughtAsset boughtAsset) { if (ModelState.IsValid) { db.BoughtAssets.Add(boughtAsset); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(boughtAsset)); }
// GET: BoughtAssets/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BoughtAsset boughtAsset = db.BoughtAssets.Find(id); if (boughtAsset == null) { return(HttpNotFound()); } return(View(boughtAsset)); }