Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("IdCliente,NombreCliente,ApellidoCliente,EmailCliente,TelefonoCliente")] TblCliente tblCliente)
        {
            if (id != tblCliente.IdCliente)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tblCliente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TblClienteExists(tblCliente.IdCliente))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tblCliente));
        }
Ejemplo n.º 2
0
 public void updateCliente(TblCliente cliente)
 {
     using (var db = new BDDotNetCore_GraphQLContext())
     {
         db.TblCliente.Update(cliente);
         db.SaveChanges();
     }
 }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("IdCliente,NombreCliente,ApellidoCliente,EmailCliente,TelefonoCliente")] TblCliente tblCliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tblCliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tblCliente));
        }
Ejemplo n.º 4
0
 public void addCliente(TblCliente cliente)
 {
     using (var db = new BDDotNetCore_GraphQLContext())
     {
         try
         {
             db.TblCliente.Add(cliente);
             db.SaveChanges();
         }
         catch (Exception e)
         {
             throw new Exception("Um problema impediu inserir o registro de Cliente. \n Analise a excessão para obter maiores detalhes. \n" + e.Message);
         }
     }
 }
Ejemplo n.º 5
0
 public void addCliente(TblCliente cliente)
 {
     new DAO.Cliente().addCliente(cliente);
 }