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 async Task SaveChangesAsync() { try { await _context.SaveChangesAsync(); await _mcContext.SaveChangesAsync(); await _maestrosContext.SaveChangesAsync(); await _mooreveContext.SaveChangesAsync(); await _sapContext.SaveChangesAsync(); await _clientesContext.SaveChangesAsync(); await _facturacionContext.SaveChangesAsync(); } catch (System.Exception e) { var msg = e.InnerException.Message; } }
public async Task InsertAsync(Customers obj) { _context.Add(obj); await _context.SaveChangesAsync(); }