public async Task <IHttpActionResult> PutAlchemyCost(int id, AlchemyCost alchemyCost) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != alchemyCost.Id) { return(BadRequest()); } db.Entry(alchemyCost).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AlchemyCostExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Initial,StrokeColor,FillColor")] AlchemyElement alchemyElement) { if (ModelState.IsValid) { _db.Entry(alchemyElement).State = EntityState.Modified; await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(alchemyElement)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,ShortName")] AlchemyRank alchemyRank) { if (ModelState.IsValid) { db.Entry(alchemyRank).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(alchemyRank)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Element,Name,VictoryPoints,Rank,Costs")] AlchemyCard alchemyCard) { if (ModelState.IsValid) { _db.Entry(alchemyCard).State = EntityState.Modified; await _db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.Element = new SelectList(_db.AlchemyElements, "Id", "Name", alchemyCard.Element); ViewBag.Rank = new SelectList(_db.AlchemyRanks, "Id", "Name", alchemyCard.Rank); return(View(alchemyCard)); }