public ActionResult DeleteConfirmed(int id)
        {
            T_UserPlc t_UserPlc = db.T_UserPlc.Find(id);

            db.T_UserPlc.Remove(t_UserPlc);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,T_UserId,T_PlcId")] T_UserPlc t_UserPlc)
 {
     if (ModelState.IsValid)
     {
         db.Entry(t_UserPlc).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.T_UserId = new SelectList(db.AspNetUsers, "Id", "Email", t_UserPlc.T_UserId);
     ViewBag.T_PlcId  = new SelectList(db.T_Plc, "Id", "Name", t_UserPlc.T_PlcId);
     return(View(t_UserPlc));
 }
        // GET: Admin/T_UserPlc/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            T_UserPlc t_UserPlc = db.T_UserPlc.Find(id);

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

            if (t_UserPlc == null)
            {
                return(HttpNotFound());
            }
            ViewBag.T_UserId = new SelectList(db.AspNetUsers, "Id", "Email", t_UserPlc.T_UserId);
            ViewBag.T_PlcId  = new SelectList(db.T_Plc, "Id", "Name", t_UserPlc.T_PlcId);
            return(View(t_UserPlc));
        }