public ActionResult DeleteConfirmed(Guid id) { MigrationTool.Models.HypervisorController hypervisorcontroller = this.db.HypervisorControllers.Single(h => h.Id == id); this.db.HypervisorControllers.DeleteObject(hypervisorcontroller); this.db.SaveChanges(); return(this.RedirectToAction("Index")); }
public ActionResult Edit(MigrationTool.Models.HypervisorController hypervisorcontroller) { if (ModelState.IsValid) { hypervisorcontroller.LastUpdated = DateTime.Now; if (hypervisorcontroller.Inactive) { if (hypervisorcontroller.InactiveDate == null) { hypervisorcontroller.InactiveDate = hypervisorcontroller.LastUpdated; } } else { if (hypervisorcontroller.InactiveDate != null) { hypervisorcontroller.InactiveDate = null; } } this.db.HypervisorControllers.Attach(hypervisorcontroller); this.db.ObjectStateManager.ChangeObjectState(hypervisorcontroller, EntityState.Modified); this.db.SaveChanges(); return(this.RedirectToAction("Details", new { id = hypervisorcontroller.Id })); } return(this.View(hypervisorcontroller)); }
public ActionResult Edit(Guid id) { MigrationTool.Models.HypervisorController hypervisorcontroller = this.db.HypervisorControllers.Single(h => h.Id == id); if (hypervisorcontroller == null) { return(this.HttpNotFound()); } return(this.View(hypervisorcontroller)); }
public ActionResult Create(MigrationTool.Models.HypervisorController hypervisorcontroller) { if (ModelState.IsValid) { hypervisorcontroller.Id = Guid.NewGuid(); hypervisorcontroller.CreatedDate = DateTime.Now; hypervisorcontroller.LastUpdated = hypervisorcontroller.CreatedDate; this.db.HypervisorControllers.AddObject(hypervisorcontroller); this.db.SaveChanges(); return(this.RedirectToAction("Details", new { id = hypervisorcontroller.Id })); } return(this.View(hypervisorcontroller)); }