public ActionResult DeleteConfirmed(int id) { Vojvoda vojvoda = vojvodaRepository.GetVojvodaByID(id); vojvodaRepository.DeleteVojvoda(id); vojvodaRepository.Save(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "VojvodaID,Name,DateOfBirth")] Vojvoda vojvoda) { if (ModelState.IsValid) { vojvodaRepository.UpdateVojvoda(vojvoda); vojvodaRepository.Save(); return(RedirectToAction("Index")); } return(View(vojvoda)); }
// GET: Vojvodas/Edit/5 public ActionResult Edit(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Vojvoda vojvoda = vojvodaRepository.GetVojvodaByID(id); if (vojvoda == null) { return(HttpNotFound()); } return(View(vojvoda)); }
public void UpdateVojvoda(Vojvoda vojvoda) { db.Entry(vojvoda).State = EntityState.Modified; }
public void DeleteVojvoda(int VojvodaID) { Vojvoda vojvoda = db.Vojvodas.Find(VojvodaID); db.Vojvodas.Remove(vojvoda); }
public void InsertVojvoda(Vojvoda vojvoda) { db.Vojvodas.Add(vojvoda); }