Exemple #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));
        }
        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));
        }
Exemple #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));
        }