public async Task <IActionResult> Create([Bind("ClientesID,Nombre,Apellido,Direccion,Telefono")] Clientes clientes) { if (ModelState.IsValid) { _context.Add(clientes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(clientes)); }
public async Task <IActionResult> Create([Bind("Id,Name")] Department department) { if (ModelState.IsValid) { _context.Add(department); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(department)); }
public async Task <IActionResult> Create([Bind("Id,UserName,Email,PhoneNumber,CPF,ReleaseDate,Convenio,Coment")] clientes clientes) { if (ModelState.IsValid) { _context.Add(clientes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(clientes)); }
public bool Incluir(ref Clientes cliente) { try { cliente.id_cliente = null; using (ClientesContext ctx = new ClientesContext()) { ctx.Add(cliente); ctx.SaveChanges(); return(true); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void Adicionar(Models.Cliente cliente) { _context.Add(cliente); }
public async Task InsertAsync(Customers obj) { _context.Add(obj); await _context.SaveChangesAsync(); }