public ActionResult Create(Schronisko schronisko, FormCollection collection) { try { // TODO: Add insert logic here _mojaBaza.Schroniska.Add(schronisko); _mojaBaza.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(Schronisko schronisko, int id, FormCollection collection) { try { // TODO: Add update logic here if (ModelState.IsValid) { _mojaBaza.Entry(schronisko).State = EntityState.Modified; _mojaBaza.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }