public async Task <IHttpActionResult> PutMapCharacterTypeStatsLevel(int id, MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != mapCharacterTypeStatsLevel.MapCharacterTypeStatsLevelId)
            {
                return(BadRequest());
            }

            db.Entry(mapCharacterTypeStatsLevel).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MapCharacterTypeStatsLevelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#2
0
        public ActionResult DeleteConfirmed(int id)
        {
            MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel = db.MapCharacterTypeStatsLevels.Find(id);

            db.MapCharacterTypeStatsLevels.Remove(mapCharacterTypeStatsLevel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public async Task <IHttpActionResult> GetMapCharacterTypeStatsLevel(int id)
        {
            MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel = await db.MapCharacterTypeStatsLevels.FindAsync(id);

            if (mapCharacterTypeStatsLevel == null)
            {
                return(NotFound());
            }

            return(Ok(mapCharacterTypeStatsLevel));
        }
        public async Task <IHttpActionResult> PostMapCharacterTypeStatsLevel(MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.MapCharacterTypeStatsLevels.Add(mapCharacterTypeStatsLevel);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = mapCharacterTypeStatsLevel.MapCharacterTypeStatsLevelId }, mapCharacterTypeStatsLevel));
        }
示例#5
0
 public ActionResult Edit([Bind(Include = "MapCharacterTypeStatsLevelId,CharacterTypeId,StatsLevelIId")] MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mapCharacterTypeStatsLevel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CharacterTypeId = new SelectList(db.CharacterTypes, "CharacterTypeId", "CharacterClass", mapCharacterTypeStatsLevel.CharacterTypeId);
     ViewBag.StatsLevelIId   = new SelectList(db.StatsLevels, "StatsLevelId", "CharacterClass", mapCharacterTypeStatsLevel.StatsLevelIId);
     return(View(mapCharacterTypeStatsLevel));
 }
        public async Task <IHttpActionResult> DeleteMapCharacterTypeStatsLevel(int id)
        {
            MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel = await db.MapCharacterTypeStatsLevels.FindAsync(id);

            if (mapCharacterTypeStatsLevel == null)
            {
                return(NotFound());
            }

            db.MapCharacterTypeStatsLevels.Remove(mapCharacterTypeStatsLevel);
            await db.SaveChangesAsync();

            return(Ok(mapCharacterTypeStatsLevel));
        }
示例#7
0
        // GET: MapCharacterTypeStatsLevels/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel = db.MapCharacterTypeStatsLevels.Find(id);

            if (mapCharacterTypeStatsLevel == null)
            {
                return(HttpNotFound());
            }
            return(View(mapCharacterTypeStatsLevel));
        }
示例#8
0
        // GET: MapCharacterTypeStatsLevels/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel = db.MapCharacterTypeStatsLevels.Find(id);

            if (mapCharacterTypeStatsLevel == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CharacterTypeId = new SelectList(db.CharacterTypes, "CharacterTypeId", "CharacterClass", mapCharacterTypeStatsLevel.CharacterTypeId);
            ViewBag.StatsLevelIId   = new SelectList(db.StatsLevels, "StatsLevelId", "CharacterClass", mapCharacterTypeStatsLevel.StatsLevelIId);
            return(View(mapCharacterTypeStatsLevel));
        }