public ActionResult DeleteConfirmed(int id) { NaszeDane naszeDane = db.NaszeDane.Find(id); db.NaszeDane.Remove(naszeDane); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,NazwaBanku,KapitałPoczątkowy,DataRozpoczęcia,Oprocentowanie,Zysk")] NaszeDane naszeDane) { if (ModelState.IsValid) { db.Entry(naszeDane).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(naszeDane)); }
public ActionResult Create([Bind(Include = "ID,NazwaBanku,KapitałPoczątkowy,DataRozpoczęcia,Oprocentowanie,Zysk")] NaszeDane naszeDane) { if (ModelState.IsValid) { db.NaszeDane.Add(naszeDane); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(naszeDane)); }
// GET: NaszeDanes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NaszeDane naszeDane = db.NaszeDane.Find(id); if (naszeDane == null) { return(HttpNotFound()); } return(View(naszeDane)); }