public ActionResult DeleteConfirmed(int id)
        {
            WorkTypeUnit workTypeUnit = db.WorkTypeUnits.Find(id);

            db.WorkTypeUnits.Remove(workTypeUnit);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,CreateTime,UpdateTime,WorkTypeId,WorkUnitId")] WorkTypeUnit workTypeUnit)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workTypeUnit).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.WorkTypeId = new SelectList(db.WorkTypes, "Id", "Name", workTypeUnit.WorkTypeId);
     ViewBag.WorkUnitId = new SelectList(db.WorkUnits, "Id", "Name", workTypeUnit.WorkUnitId);
     return(View(workTypeUnit));
 }
        // GET: WorkTypeUnits/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WorkTypeUnit workTypeUnit = db.WorkTypeUnits.Find(id);

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

            if (workTypeUnit == null)
            {
                return(HttpNotFound());
            }
            ViewBag.WorkTypeId = new SelectList(db.WorkTypes, "Id", "Name", workTypeUnit.WorkTypeId);
            ViewBag.WorkUnitId = new SelectList(db.WorkUnits, "Id", "Name", workTypeUnit.WorkUnitId);
            return(View(workTypeUnit));
        }