コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ARTISTs aRTISTs = db.ARTISTs.Find(id);

            db.ARTISTs.Remove(aRTISTs);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        // 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));
        }
コード例 #4
0
        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));
        }