public async Task <IActionResult> Create([Bind("ProductCartId")] ProductCart productCart)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productCart);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(productCart));
        }
        public async Task <IActionResult> Create([Bind("ProductId,Name,InStock,Price,Imagine,QuantityInStock,Quantities")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product));
        }
        public async Task <IActionResult> Create([Bind("RoleId,Name")] Role role)
        {
            if (ModelState.IsValid)
            {
                _context.Add(role);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(role));
        }
        public async Task <IActionResult> Create([Bind("ProductDetailsId,Size,Material,Color")] ProductDetails productDetails)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productDetails);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(productDetails));
        }
예제 #5
0
        public async Task <IActionResult> Create([Bind("UserId,FirstName,LastName,PhoneNumber,EmailAdress,Passworld")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
        public async Task <IActionResult> Create([Bind("DeliveryId,Country,City,Street,Number,CartId")] Delivery delivery)
        {
            if (ModelState.IsValid)
            {
                _context.Add(delivery);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CartId"] = new SelectList(_context.Carts, "CartId", "CartId", delivery.CartId);
            return(View(delivery));
        }