コード例 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            Work_center work_center = db.Work_centers.Find(id);

            db.Work_centers.Remove(work_center);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "WorkcenterID,WorkcenterName")] Work_center work_center)
 {
     if (ModelState.IsValid)
     {
         db.Entry(work_center).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(work_center));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "WorkcenterID,WorkcenterName")] Work_center work_center)
        {
            if (ModelState.IsValid)
            {
                db.Work_centers.Add(work_center);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(work_center));
        }
コード例 #4
0
        // GET: Work_Centers/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Work_center work_center = db.Work_centers.Find(id);

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