public ActionResult DeleteConfirmed(int id) { ARTISTs aRTISTs = db.ARTISTs.Find(id); db.ARTISTs.Remove(aRTISTs); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,NAME,DOB,BIRTHCITY")] ARTISTs aRTISTs) { if (ModelState.IsValid) { db.Entry(aRTISTs).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aRTISTs)); }
// GET: ARTISTs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ARTISTs aRTISTs = db.ARTISTs.Find(id); if (aRTISTs == null) { return(HttpNotFound()); } return(View(aRTISTs)); }
public ActionResult Create([Bind(Include = "ID,NAME,DOB,BIRTHCITY")] ARTISTs aRTISTs) { //Don't allow time beyond or long names if (aRTISTs.NAME.Length > 50 || aRTISTs.DOB > DateTime.Now) { return(View(aRTISTs)); } if (ModelState.IsValid) { db.ARTISTs.Add(aRTISTs); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aRTISTs)); }