Пример #1
0
        public async Task <IActionResult> PutGames(long id, Games games)
        {
            if (id != games.Id)
            {
                return(BadRequest());
            }

            _context.Entry(games).State = EntityState.Modified;

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

            return(NoContent());
        }
 public async Task <IHttpActionResult> Put([FromODataUri] int key, Game update)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     if (key != update.Id)
     {
         return(BadRequest());
     }
     db.Entry(update).State = EntityState.Modified;
     try
     {
         await db.SaveChangesAsync();
     }
     catch (DbUpdateConcurrencyException)
     {
         if (!GameExists(key))
         {
             return(NotFound());
         }
         else
         {
             throw;
         }
     }
     return(Updated(update));
 }
Пример #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,ReleaseDate")] Platform platform)
 {
     if (ModelState.IsValid)
     {
         db.Entry(platform).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(platform));
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "CustomerID,CustomerName,Address,Contact, Email")] Customer customer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customer));
 }
Пример #5
0
 public ActionResult Edit([Bind(Include = "GameID,GameName,GameDescription,Platform")] GamesData games)
 {
     if (ModelState.IsValid)
     {
         db.Entry(games).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(games));
 }
Пример #6
0
 public ActionResult Edit([Bind(Include = "Id,Title,Genre,ReleaseDate,Rating")] Game game)
 {
     if (ModelState.IsValid)
     {
         db.Entry(game).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(game));
 }
Пример #7
0
 public ActionResult Edit([Bind(Include = "Id,Nome,CodigoBarras,Genero,DataLancamento,Preco,CreationDate")] Jogo jogo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(jogo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(jogo));
 }
Пример #8
0
 public ActionResult Edit([Bind(Include = "Id,Nome,CNPJ,Telefone,Email,CreationDate")] Fornecedor fornecedor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fornecedor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fornecedor));
 }
Пример #9
0
 public ActionResult Edit([Bind(Include = "Id,Name,Playable")] Character character)
 {
     if (ModelState.IsValid)
     {
         db.Entry(character).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(character));
 }
Пример #10
0
 public ActionResult Edit([Bind(Include = "ID,Name, Team, Points")] Score score)
 {
     if (ModelState.IsValid)
     {
         db.Entry(score).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(score));
 }
Пример #11
0
 public ActionResult Edit([Bind(Include = "Id,QuantidadeTotal,QuantidadeDisponivel,IdJogo,CreationDate")] Estoque estoque)
 {
     if (ModelState.IsValid)
     {
         db.Entry(estoque).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(estoque));
 }
Пример #12
0
 public ActionResult Edit([Bind(Include = "Id,Nome,Usuario,Cpf,Telefone,Salario,IsAtivo,IsGerente,CreationDate")] Funcionario funcionario)
 {
     if (ModelState.IsValid)
     {
         db.Entry(funcionario).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(funcionario));
 }
Пример #13
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Developer developer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(developer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(developer));
 }
Пример #14
0
 public ActionResult Edit([Bind(Include = "Id,QuantidadeEntregue,NumeroEntrega,DataEntrega,IdFornecedor,CreationDate")] Entrega entrega)
 {
     if (ModelState.IsValid)
     {
         db.Entry(entrega).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(entrega));
 }
Пример #15
0
 public ActionResult Edit([Bind(Include = "StatusID")] Status status)
 {
     if (ModelState.IsValid)
     {
         db.Entry(status).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(status));
 }
Пример #16
0
 public ActionResult Edit([Bind(Include = "MatchID,match_id,match_seq_num,start_time,lobby_type,radiant_team_id,dire_team_id,radiant_win,duration,tower_status_radiant,tower_status_dire,barracks_status_radiant,barracks_status_dire,first_blood_time,radiant_score,dire_score")] Match match)
 {
     if (ModelState.IsValid)
     {
         db.Entry(match).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(match));
 }
Пример #17
0
 public ActionResult Edit([Bind(Include = "PlayerID,MatchID,account_id,player_slot,hero_id,item_0,item_1,item_2,item_3,item_4,item_5,kills,deaths,assists,leaver_status,last_hits,denies,gold_per_min,xp_per_min,level,gold,gold_spent,hero_damage,tower_damage,hero_healing")] Player player)
 {
     if (ModelState.IsValid)
     {
         db.Entry(player).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MatchID = new SelectList(db.Matches, "MatchID", "MatchID", player.MatchID);
     return(View(player));
 }
Пример #18
0
        public async Task <IActionResult> PutGame(long id, Game game)
        {
            if (id != game.Id)
            {
                return(BadRequest());
            }

            _context.Entry(game).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }
Пример #19
0
 public ActionResult Edit([Bind(Include = "AdID,CustomerID,GameID,GameName, GameDescription, Price,AdCommenceDate,Adexpirydate,Swap")] Ad ad)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ad).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerID = new SelectList(db.Customer, "CustomerID", "CustomerName", ad.CustomerID);
     ViewBag.GameID     = new SelectList(db.games, "GameID", "GameName", ad.GameID);
     return(View(ad));
 }
 public ActionResult EditMatch(Match match)
 {
     db.Entry(match).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("EditMatches"));
 }
Пример #21
0
 public void Update(Game game)
 {
     _context.Entry(game).State = EntityState.Modified;
 }