public ActionResult DeleteConfirmed(int id) { OnlineDobavljac onlineDobavljac = db.Dobavljacs.Find(id); db.Dobavljacs.Remove(onlineDobavljac); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Ime,Aktivan,Email,WebsiteURL")] OnlineDobavljac onlineDobavljac) { if (ModelState.IsValid) { db.Entry(onlineDobavljac).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(onlineDobavljac)); }
public ActionResult Create([Bind(Include = "Id,Ime,Aktivan,Email,WebsiteURL")] OnlineDobavljac onlineDobavljac) { if (ModelState.IsValid) { db.Dobavljacs.Add(onlineDobavljac); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(onlineDobavljac)); }
// GET: OnlineDobavljacs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OnlineDobavljac onlineDobavljac = db.Dobavljacs.Find(id); if (onlineDobavljac == null) { return(HttpNotFound()); } return(View(onlineDobavljac)); }