public ActionResult DeleteConfirmed(string id) { PcInfo pcInfo = db.PcInfos.Find(id); db.PcInfos.Remove(pcInfo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ControlNumber,IpAddress,Use,Type,ModelNumber,UserName,PcName,Remarks1,Remarks2")] PcInfo pcInfo) { if (ModelState.IsValid) { db.Entry(pcInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pcInfo)); }
public ActionResult Create([Bind(Include = "ControlNumber,IpAddress,Use,Type,ModelNumber,UserName,PcName,Remarks1,Remarks2")] PcInfo pcInfo) { if (ModelState.IsValid) { db.PcInfos.Add(pcInfo); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pcInfo)); }
public Lan(bool[,] relationsMatrix, PcInfo[] computers) { this.relationsMatrix = relationsMatrix; this.computers = computers; rand = new Random(); infected = new bool[computers.Length]; for (int i = 0; i < computers.Length; i++) { infected[i] = computers[i].Infected; } }
// GET: PcInfo/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PcInfo pcInfo = db.PcInfos.Find(id); if (pcInfo == null) { return(HttpNotFound()); } return(View(pcInfo)); }