Example #1
0
        public async Task <IActionResult> Create([Bind("ID,Code,Title,Price")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("ID,Name,Email,Birthdate,Gender")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("ID,ClientId,Client,ProductId,Quantity,Status")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

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