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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
 public async Task InsertAsync(Customers obj)
 {
     _context.Add(obj);
     await _context.SaveChangesAsync();
 }