コード例 #1
0
        public ActionResult RemoveEngineer(int id)
        {
            MachineEngineer me        = _db.MachineEngineers.FirstOrDefault(x => x.MachineEngineerId == id);
            int             machineid = me.MachineId;

            _db.MachineEngineers.Remove(me);
            _db.SaveChanges();
            return(RedirectToAction("Details", new { id = machineid }));
        }
コード例 #2
0
        public ActionResult Remove(int id)
        {
            MachineEngineer me = _db.MachineEngineers.Include(x => x.Machine).Include(x => x.Engineer).FirstOrDefault(x => x.MachineEngineerId == id);

            return(View(me));
        }