コード例 #1
0
        public void EditWorkCategory(string name, int id)
        {
            WORKS_CATEGORY slctd_wk = db.WORKS_CATEGORY.Find(id);

            slctd_wk.NAME = name;
            db.SaveChanges();
        }
コード例 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            WORKS_CATEGORY wORKS_CATEGORY = db.WORKS_CATEGORY.Find(id);

            db.WORKS_CATEGORY.Remove(wORKS_CATEGORY);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public ActionResult Edit([Bind(Include = "OBJECTID,NAME")] WORKS_CATEGORY wORKS_CATEGORY)
 {
     if (ModelState.IsValid)
     {
         db.Entry(wORKS_CATEGORY).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(wORKS_CATEGORY));
 }
コード例 #4
0
        public void AddWorkCategory(string name)
        {
            WORKS_CATEGORY new_wk = new WORKS_CATEGORY
            {
                NAME = name
            };

            db.WORKS_CATEGORY.Add(new_wk);
            db.SaveChanges();
        }
コード例 #5
0
        public ActionResult Create([Bind(Include = "OBJECTID,NAME")] WORKS_CATEGORY wORKS_CATEGORY)
        {
            if (ModelState.IsValid)
            {
                db.WORKS_CATEGORY.Add(wORKS_CATEGORY);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(wORKS_CATEGORY));
        }
コード例 #6
0
        // GET: AgroPark/WORKS_CATEGORY/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WORKS_CATEGORY wORKS_CATEGORY = db.WORKS_CATEGORY.Find(id);

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