Example #1
0
        public async Task <IActionResult> Create([Bind("Direccion,IdCliente,Cedula,Nombre,Apellido")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
        public async Task <IActionResult> Create([Bind("IdEmpresa,Nombre,Propietario")] Empresa empresa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(empresa);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(empresa));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("IdMotor,Marca,TipoDeMotor")] Motor motor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(motor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(motor));
        }
        public async Task <IActionResult> Create([Bind("IdVehiculo,Modelo,Color,IdMotor,IdEmpresa")] Vehiculo vehiculo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vehiculo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            MotorList(vehiculo.IdMotor);
            return(View(vehiculo));
        }