public ActionResult DeleteConfirmed(Guid id) { PhaseTerritory phaseTerritory = db.PhaseTerritories.Find(id); db.PhaseTerritories.Remove(phaseTerritory); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,TotalPointsEarned,TerritoryPlatoon1_Id,TerritoryPlatoon2_Id,TerritoryPlatoon3_Id,TerritoryPlatoon4_Id,TerritoryPlatoon5_Id,TerritoryPlatoon6_Id")] PhaseTerritory phaseTerritory) { if (ModelState.IsValid) { db.Entry(phaseTerritory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(phaseTerritory)); }
public ActionResult Create(PhaseTerritory phaseTerritory) { if (ModelState.IsValid) { phaseTerritory.Id = Guid.NewGuid(); db.PhaseTerritories.Add(phaseTerritory); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(phaseTerritory)); }
public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PhaseTerritory phaseTerritory = db.PhaseTerritories.Find(id); if (phaseTerritory == null) { return(HttpNotFound()); } return(View(phaseTerritory)); }
public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PhaseTerritory phaseTerritory = db.PhaseTerritories.Include(x => x.TerritoryBattlePhase).SingleOrDefault(x => x.Id == id); if (phaseTerritory == null) { return(HttpNotFound()); } PhaseTerritoryModel model = Mapper.Map <PhaseTerritory, PhaseTerritoryModel>(phaseTerritory); return(View(model)); }