Пример #1
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            PhaseTerritory phaseTerritory = db.PhaseTerritories.Find(id);

            db.PhaseTerritories.Remove(phaseTerritory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        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));
        }
Пример #3
0
        public ActionResult Create(PhaseTerritory phaseTerritory)
        {
            if (ModelState.IsValid)
            {
                phaseTerritory.Id = Guid.NewGuid();
                db.PhaseTerritories.Add(phaseTerritory);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(phaseTerritory));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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));
        }