예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tableC tableC = db.tableCs.Find(id);

            db.tableCs.Remove(tableC);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult updateList3(string temp)
        {
            tableC TC = new tableC();

            TC.name = temp;
            db.tableCs.Add(TC);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
 public ActionResult Edit([Bind(Include = "id,name")] tableC tableC)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tableC).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tableC));
 }
예제 #4
0
        public ActionResult Create([Bind(Include = "id,name")] tableC tableC)
        {
            if (ModelState.IsValid)
            {
                db.tableCs.Add(tableC);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tableC));
        }
예제 #5
0
        // GET: tableCs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tableC tableC = db.tableCs.Find(id);

            if (tableC == null)
            {
                return(HttpNotFound());
            }
            return(View(tableC));
        }