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

            db.ass_category.Remove(ass_category);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        // GET: AssCategory/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ass_category ass_category = db.ass_category.Find(id);

            if (ass_category == null)
            {
                return(HttpNotFound());
            }
            return(View(ass_category));
        }
예제 #3
0
        public ActionResult Edit([Bind(Include = "id,parent_id,name,descs,work_duration")] ass_category ass_category)
        {
            if (ModelState.IsValid)
            {
                ass_category.audit_date = DateTime.Now;
                ass_category.user_id    = int.Parse(User.Identity.Name);

                db.Entry(ass_category).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.parent_id = new SelectList(db.ass_category, "id", "name", ass_category.parent_id);
            return(View(ass_category));
        }
예제 #4
0
        // GET: AssCategory/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ass_category ass_category = db.ass_category.Find(id);

            if (ass_category == null)
            {
                return(HttpNotFound());
            }
            ViewBag.parent_id = new SelectList(db.ass_category, "id", "name", ass_category.parent_id);
            return(View(ass_category));
        }