public ActionResult DeleteConfirmed(int id)
        {
            DocFileCode docFileCode = db.DocFileCodes.Find(id);

            db.DocFileCodes.Remove(docFileCode);
            db.SaveChanges();
            Audit.Trail(docFileCode.Description, eAction.Delete, docFileCode.Id.ToString());
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,UnitId,Description")] DocFileCode docFileCode)
 {
     if (ModelState.IsValid)
     {
         db.Entry(docFileCode).State = EntityState.Modified;
         db.SaveChanges();
         Audit.Trail(docFileCode.Description, eAction.Update, docFileCode.Id.ToString());
         return(RedirectToAction("Index"));
     }
     ViewBag.UnitId = new SelectList(db.Units, "UnitId", "Description", docFileCode.UnitId);
     return(View(docFileCode));
 }
        public ActionResult Create([Bind(Include = "Id,UnitId,Description")] DocFileCode docFileCode)
        {
            if (ModelState.IsValid)
            {
                db.DocFileCodes.Add(docFileCode);
                db.SaveChanges();
                Audit.Trail(docFileCode.Description, eAction.Create, docFileCode.Id.ToString());
                return(RedirectToAction("Index"));
            }

            ViewBag.UnitId = new SelectList(db.Units, "UnitId", "Description", docFileCode.UnitId);
            return(View(docFileCode));
        }
        // GET: DocFileCodes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DocFileCode docFileCode = db.DocFileCodes.Find(id);

            if (docFileCode == null)
            {
                return(HttpNotFound());
            }
            return(View(docFileCode));
        }
        // GET: DocFileCodes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DocFileCode docFileCode = db.DocFileCodes.Find(id);

            if (docFileCode == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UnitId = new SelectList(db.Units, "UnitId", "Description", docFileCode.UnitId);
            return(View(docFileCode));
        }