public ActionResult Edit([Bind(Include = "DesignerId,Name")] PortretDesigner portretDesigner) { if (ModelState.IsValid) { db.Entry(portretDesigner).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(portretDesigner)); }
public ActionResult Create([Bind(Include = "DesignerId,Name")] PortretDesigner portretDesigner) { if (ModelState.IsValid) { db.PortretDesigners.Add(portretDesigner); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(portretDesigner)); }
// GET: PortretDesigners/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PortretDesigner portretDesigner = db.PortretDesigners.Find(id); if (portretDesigner == null) { return(HttpNotFound()); } return(View(portretDesigner)); }
// GET: PortretDesigners/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PortretDesigner portretDesigner = db.PortretDesigners.Find(id); if (portretDesigner == null) { return(HttpNotFound()); } db.PortretDesigners.Remove(portretDesigner); db.SaveChanges(); return(RedirectToAction("Index")); }