Example #1
0
 public ActionResult Edit([Bind(Include = "ComandaID,ServicoID,VagaID,ClienteID,VeiculoID")] Comanda comanda)
 {
     if (ModelState.IsValid)
     {
         Comanda comandaToUpdate = comandaService.ShortShow(comanda.ComandaID);
         comandaToUpdate.ServicoID = comanda.ServicoID;
         comandaToUpdate.VagaID    = comanda.VagaID;
         comandaToUpdate.ClienteID = comanda.ClienteID;
         comandaToUpdate.VeiculoID = comanda.VeiculoID;
         comandaService.Update(comandaToUpdate);
         return(Json(new { Status = "OK" }));
     }
     return(Json(base.ErrorsToJson()));
 }
Example #2
0
        public async Task <IActionResult> Edit(int id, Comanda comanda)
        {
            if (id != comanda.Id)
            {
                return(BadRequest());
            }
            try
            {
                comanda.Data = DateTime.Now.ToString();
                await _comandaService.Update(comanda);

                return(RedirectToAction(nameof(Index)));
            }
            catch (NotFoundException)
            {
                return(NotFound());
            }
            catch (DbConcurrencyException)
            {
                return(BadRequest());
            }
        }
Example #3
0
 public void UpdateComanda(ComandaDto comandaDto)
 {
     comandaService.Update(comandaDto);
 }