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")); }
// 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)); }
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)); }
// 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)); }