public ActionResult DeleteConfirmed(int id) { Bitka bitka = bitkaRepository.GetBitkasByID(id); bitkaRepository.DeleteBitkas(id); bitkaRepository.Save(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BitkaId,Lokacija,Datum")] Bitka bitka) { if (ModelState.IsValid) { bitkaRepository.UpdateBitkas(bitka); bitkaRepository.Save(); return(RedirectToAction("Index")); } return(View(bitka)); }
// GET: Bitkas/Edit/5 public ActionResult Edit(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Bitka bitka = bitkaRepository.GetBitkasByID(id); if (bitka == null) { return(HttpNotFound()); } return(View(bitka)); }
public void UpdateBitkas(Bitka bitka) { db.Entry(bitka).State = EntityState.Modified; }
public void InsertBitkas(Bitka bitka) { db.Bitkas.Add(bitka); }
public void DeleteBitkas(int BitkaID) { Bitka bitka = db.Bitkas.Find(BitkaID); db.Bitkas.Remove(bitka); }