Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Address,Cellno,Salary,Commission")] SalesPerson salesPerson)
        {
            if (ModelState.IsValid)
            {
                _context.Add(salesPerson);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(salesPerson));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Name,Id,Location")] Branch branch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(branch);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(branch));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Make,Model,Variant,Price,Mileage,Year,Id")] Car car)
        {
            if (ModelState.IsValid)
            {
                _context.Add(car);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(car));
        }